Commit 674ae4b
authored
Resolves #651
From that issue:
The OpenAPI spec [section](https://swagger.io/specification/) on the
`Schema` object says:
> The Schema Object allows the definition of input and output data
types. These types can be objects, but also primitives and arrays. This
object is a superset of the [JSON Schema Specification Draft
2020-12](https://tools.ietf.org/html/draft-bhutton-json-schema-00).
>
> For more information about the properties, see [JSON Schema
Core](https://tools.ietf.org/html/draft-bhutton-json-schema-00) and
[JSON Schema
Validation](https://tools.ietf.org/html/draft-bhutton-json-schema-validation-00).
The JSON Schema Validation spec
[says](https://json-schema.org/draft/2020-12/json-schema-validation#name-required)
of the `required` property:
> The value of this keyword MUST be an array. Elements of this array, if
any, MUST be strings, and MUST be unique.
>
> An object instance is valid against this keyword if every item in the
array is the name of a property in the instance.
>
> Omitting this keyword has the same behavior as an empty array.
... which makes pretty clear that specifying an empty array for
`required` is supported by JSON Schema, and thus by OpenAPI, and thus
should be supported by this tool's model of OpenAPI.
1 parent a0b1bb7 commit 674ae4b
File tree
1 file changed
+1
-1
lines changed- openapi_python_client/schema/openapi_schema_pydantic
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
0 commit comments