-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle "type" being an array of strings in JSON schema converter (#423)
Updates to handle the case where a `type` in JSON schema is an array of strings, like `{"type": ["null", "string", "boolean", "number"]}`. From the [JSON schema docs](https://json-schema.org/understanding-json-schema/reference/type#type-specific-keywords) > The type keyword may either be a string or an array: > > If it's a string, it is the name of one of the basic types above. > If it is an array, it must be an array of strings, where each string > is the name of one of the basic types, and each element is unique. I added tests to make sure nullable/optional types are converted correctly, and that properties of an object that are both not required & a union with null (`{"type": ["null", "string"]}`) are not made "double nullable". Closes #412
- Loading branch information
Showing
3 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters