Open joelposti opened 2 years ago
It seems tests do not pass after making these changes. I will fix the issue.
I fixed the issue. Tests pass now.
Hei @Hilzu! Could you take a look at this pull request? I would like to have this issue fixed here in the upstream.
Improved SchemaObject interface. Many of its properties can be of type ReferenceObject per OpenAPI specification.
Issue
Currently OpenAPI document that makes use of
$ref
in SchemaObjects do not pass TypeScript type checking because SchemaObject does not allow ReferenceObjects although the OpenAPI specification allows them. The following valid use cases of ReferenceObject do not pass type checking.Argument for the changes in this PR
The use cases demonstrated above should be valid according to OpenAPI specification at https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schema-object and should thus pass type checking.
Explanation on the part of
properties
leaves open the question whether individual properties can be ReferenceObjects. But I think they can because there is an example of such usage in the same specification document https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#simple-model.