Skip to content

Make the generated schema be more consistent with the serializer behaviour#21

Merged
panesofglass merged 28 commits intofsprojects:masterfrom
moinessim:master
Mar 16, 2025
Merged

Make the generated schema be more consistent with the serializer behaviour#21
panesofglass merged 28 commits intofsprojects:masterfrom
moinessim:master

Conversation

@moinessim
Copy link
Collaborator

  • Make (Non optional/nullable/skippable) record fields be required.
    Fixes Question: How does one generate the JsonSchema "required" field #9
  • Do not unwrap single case unions: This allows them to roundtrip serialization and validation.
  • Use NJsonSchema setting to generate documentation fields for the schema, based on F# comments (generated xml docs).
    Got it to work for records, but not for unions, yet.
  • Use context.ContextualType.Type instead of context.Type, since it is deprecated.

Moises Nessim and others added 28 commits May 30, 2023 20:36
Use net6.0 since net5.0 is not supported

Use fluid version of JsonConverterOptions

Allow SkippableOptionFields, since the lack of it was causing tests to fail
Refactor the serializer options to be more DRY

Modify and fix tests

[B1PC-4]
so that they can be validated and roundtripped correctly.

[B1PC-4]
…t resolver

to the Generator.Generate method

Do not process reference schemas, to avoid infinite recursion

Avoid double dictionary lookups by returning a tuple

[B1PC-4]
The generator will use the existent cache in the passed resolver

[B1PC-4]
Set Version before build

Use net8.0 in build.sh
@panesofglass panesofglass merged commit a6bd999 into fsprojects:master Mar 16, 2025
1 check passed
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.

Question: How does one generate the JsonSchema "required" field

2 participants