Skip to content
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

JsonProperty not working on version 11.0.0 (working on 10.9.0) #1696

Open
CaseyHofland opened this issue Apr 25, 2024 · 1 comment
Open

JsonProperty not working on version 11.0.0 (working on 10.9.0) #1696

CaseyHofland opened this issue Apr 25, 2024 · 1 comment

Comments

@CaseyHofland
Copy link

On version 11.0.0,
When I var json = JsonSchema.FromType<MyType>().ToJson();,
[JsonProperty("stuff")] will be ignored.

When I'm on version 10.9.0, it works.

Thought I'd let you know :)

@devlux
Copy link

devlux commented Jun 1, 2024

hi @CaseyHofland

I run into the same issue and was able to fix it by using

var json = NewtonsoftJsonSchemaGenerator.FromType<MyType>().ToJson();

By default JsonSchema.FromType now uses System.Text.Json and therefore doesn't consider Newtonsoft annotations.

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

No branches or pull requests

2 participants