api-elements.js
api-elements.js copied to clipboard
Error when `allOf` is used with contradictory `type`
For example, the following schema is invalid and cannot be met:
allOf:
- type: array
- type: string
It is not possible to have a type that is both array and string. Thus we cannot create a data structure or valid message body.
allOf is an openapi3 spec not openapi 2
@anonkey allOf is available in OpenAPI 2, it's listed in spec for Schema Object (https://github.com/OAI/OpenAPI-Specification/blob/1d4e51ff5ad9a81fab656f5a50b220910ff62cf6/versions/2.0.md#schema-object), in particular this clause:
The following properties are taken from the JSON Schema definition but their definitions were adjusted to the Swagger Specification. Their definition is the same as the one from JSON Schema, only where the original definition references the JSON Schema definition, the Schema Object definition is used instead.
- items
- allOf
- properties
- additionalProperties