Skip to content

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
// 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