fix: ExampleGenerator correctly generates allOf composed schemas (#17499)

* fix: ExampleGenerator correctly generates allOf composed schemas

Changes the previous behavior of generating `null` examples for allOf composed schemas.

Fixes #17497

* fix: ExampleGenerator correctly generates anyOf and oneOf composed schemas

Changes the previous behavior of generating `null` examples for anyOf and oneOf composed schemas.

To generate a oneOf/anyOf example, we generate the example using the first valid schema available. In case of a $ref, we use the first valid reference.

Fixes #17497
This commit is contained in:
Alexis Couvreur
2024-01-09 22:04:11 -05:00
committed by GitHub
parent 8bab0ceb53
commit dd5c7e3b9a
30 changed files with 288 additions and 9 deletions

View File

@@ -1942,6 +1942,10 @@ components:
otherProperty:
type: string
type: object
example:
otherProperty: otherProperty
nullableProperty: nullableProperty
type: ChildWithNullable
StringBooleanMap:
additionalProperties:
type: boolean