-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore inline schemas in oneOf with discriminator (#189)
### Motivation Currently, when provided with a `oneOf` with a `discriminator`, the generator will fail if any of the schemas are not references. However, the OpenAPI specification states that inline schemas should be ignored when using a discriminator: > When using the discriminator, inline schemas will not be considered. > — https://spec.openapis.org/oas/v3.0.3#discriminator-object The generator shouldn't fail when presented with a spec-compliant OpenAPI document, however misguided it might be. ### Modifications Filter out inline schemas during schema validation and translation. ### Result Can handle documents with `oneOf` types with a discriminator, containing inline schemas. ### Test Plan - Updated unit tests for supported/unsupported schemas. - Updated snippet test with an example, which failed before this patch. ### Resolves - Fixes #181 Signed-off-by: Si Beaumont <[email protected]>
- Loading branch information
1 parent
8f64727
commit 155bd4c
Showing
4 changed files
with
86 additions
and
9 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
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