Skip to content

Make McpJsonUtilities public and remove IVT to sample #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025

Conversation

stephentoub
Copy link
Contributor

Also adds in the same encoder used by AIJsonUtilities.

Also adds in the same encoder used by AIJsonUtilities.
@stephentoub stephentoub requested review from eiriktsarpalis and halter73 and removed request for eiriktsarpalis and halter73 March 19, 2025 22:08
@@ -26,23 +47,31 @@ private static JsonSerializerOptions CreateDefaultOptions()
// If reflection-based serialization is enabled by default, use it, as it's the most permissive in terms of what it can serialize,
// and we want to be flexible in terms of what can be put into the various collections in the object model.
// Otherwise, use the source-generated options to enable trimming and Native AOT.
JsonSerializerOptions options;

if (JsonSerializer.IsReflectionEnabledByDefault)
Copy link
Member

Choose a reason for hiding this comment

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

I think this is a good stopgap, but longer term we should look at using the source generator everywhere. Whether we can do this or not is a function of allowing user-defined types to be inserted in the DTOs. I don't believe that would be necessary -- the protocol should only deal with closed types.

@eiriktsarpalis eiriktsarpalis merged commit 6b8c288 into main Mar 20, 2025
9 of 12 checks passed
@eiriktsarpalis eiriktsarpalis deleted the mcpjsonutilities branch March 20, 2025 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants