Skip to content

fix up json pointer (and a couple others)#624

Merged
gregsdennis merged 1 commit into
native-aotfrom
native-aot-pointer
Jan 27, 2024
Merged

fix up json pointer (and a couple others)#624
gregsdennis merged 1 commit into
native-aotfrom
native-aot-pointer

Conversation

@gregsdennis

Copy link
Copy Markdown
Collaborator

No description provided.

[JsonSerializable(typeof(VocabularyKeyword))]
[JsonSerializable(typeof(WriteOnlyKeyword))]
[JsonSerializable(typeof(EvaluationResults))]
[JsonSerializable(typeof(JsonPointer))]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to find a way to just add in the type resolver exposed by JsonPointer rather than have to regen it.

@eiriktsarpalis, any ideas?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming you're only looking to serialize JsonPointer as a root-level value (and not types containing JsonPointer as a nested values which necessitates regeneration), you could try using this combinator. It can be combined like so:

JsonTypeInfoResolver.Combine(ContextA.Default, ContextB,Default);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking for a way to incorporate it directly into the serializer context.

We eventually found a way using the serializer options. We've extracted it into what is currently called TypeResolverOptionsManager in Json.More. It's not the most elegant right now, but it works by creating a serializer options that includes dependency type resolvers.

@gregsdennis gregsdennis mentioned this pull request Jan 27, 2024
17 tasks
@github-actions

Copy link
Copy Markdown

Test Results

    15 files  ±0      15 suites  ±0   13s ⏱️ ±0s
20 195 tests ±0  18 837 ✅ ±0  1 358 💤 ±0  0 ❌ ±0 
20 564 runs  ±0  19 158 ✅ ±0  1 406 💤 ±0  0 ❌ ±0 

Results for commit 6dae3f7. ± Comparison against base commit 516597c.

@gregsdennis gregsdennis mentioned this pull request Jan 27, 2024
@gregsdennis gregsdennis merged commit 51fdaa0 into native-aot Jan 27, 2024
@gregsdennis gregsdennis deleted the native-aot-pointer branch January 27, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants