-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add JsonSchemaExporter. #103322
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
Add JsonSchemaExporter. #103322
Conversation
|
Note regarding the |
|
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis |
gregsdennis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conversions look mostly good. I've left some comments mostly to make other readers aware of the JSON Schema side of things.
src/libraries/System.Text.Json/src/System/Text/Json/Schema/JsonSchema.cs
Show resolved
Hide resolved
src/libraries/System.Text.Json/src/System/Text/Json/Schema/JsonSchemaExporterContext.cs
Show resolved
Hide resolved
...stem.Text.Json/src/System/Text/Json/Serialization/Converters/Value/JsonPrimitiveConverter.cs
Outdated
Show resolved
Hide resolved
...stem.Text.Json/src/System/Text/Json/Serialization/Converters/Value/JsonPrimitiveConverter.cs
Show resolved
Hide resolved
...stem.Text.Json/src/System/Text/Json/Serialization/Converters/Value/JsonPrimitiveConverter.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/tests/Common/JsonSchemaExporterTests.TestTypes.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/tests/Common/JsonSchemaExporterTests.TestTypes.cs
Show resolved
Hide resolved
src/libraries/System.Text.Json/tests/Common/JsonSchemaExporterTests.TestTypes.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/tests/Common/JsonSchemaExporterTests.TestTypes.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/tests/Common/JsonSchemaExporterTests.TestTypes.cs
Show resolved
Hide resolved
src/libraries/System.Text.Json/src/System/Text/Json/Schema/JsonSchemaExporterOptions.cs
Outdated
Show resolved
Hide resolved
|
Summarizing my inline comments here that were intended to give other reviewers some JSON Schema context. Usage of
|
src/libraries/System.Text.Json/src/System/Text/Json/Schema/JsonSchema.cs
Outdated
Show resolved
Hide resolved
...raries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverter.cs
Outdated
Show resolved
Hide resolved
...es/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/TimeSpanConverter.cs
Outdated
Show resolved
Hide resolved
d5f9a62 to
54274cf
Compare
Fix #102788. This implementation differs somewhat compared to the stj-schema-mapper prototype in a few ways:
OnSchemaNodeGeneratedcallback is invoked for$refschemas.$refschemas are only being generated for recursive types.{ }and{"not": true }node schemas are normalized intotrueandfalserespectively.