-
-
Notifications
You must be signed in to change notification settings - Fork 528
Generation of schema that references outside schema #1131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
This seems like a definite bug. Thank you for the thorough reproduction! 🙏 That helps immensely in diagnosing the problem. |
2 tasks
The issue here is that the external schema looks like: Problem:
type: object
properties:
type:
type: string
format: uri
description: |
An absolute URI that identifies the problem type. When dereferenced,
it SHOULD provide human-readable documentation for the problem type
(e.g., using HTML).
default: 'about:blank'
example: 'https://zalando.github.io/problem/constraint-violation'
title:
type: string
description: |
A short, summary of the problem type. Written in english and readable
for engineers (usually not suited for non technical stakeholders and
not localized); example: Service Unavailable
status:
type: integer
format: int32
description: |
The HTTP status code generated by the origin server for this occurrence
of the problem.
minimum: 100
maximum: 600
exclusiveMaximum: true
example: 503
detail:
type: string
description: |
A human readable explanation specific to this occurrence of the
problem.
example: Connection to database timed out
instance:
type: string
format: uri
description: |
An absolute URI that identifies the specific occurrence of the problem.
It may or may not yield further information if dereferenced. Even though the $ref specifies
the subschema is being read as {
"hint": "SchemaObject",
"schema": {
"Problem": {
"type": "object",
"properties": { ... }
}
}
} instead of {
"hint": "SchemaObject",
"schema": {
"type": "object",
"properties": { ... }
}
} (So in this case, not a SchemaObject, but one level above, the Map<string, SchemaObject>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Description
Generation of a schema, that references other schemas in the $ref results in a invalid schema.ts, with "unkown" types and wrong property referencing
Property 'Problem' does not exist on type 'unknown'
openapi-typescript
6.2.4
20.1.0
macOS 13, Windows 11, etc.
Reproduction
Run following code as a .yml in the generator:
How can this be reproduced / when did the error occur?
Generate a schema based on the prior .yml file.
Expected result
(in case it’s not obvious)
Checklist
npx @redocly/cli@latest lint
)The text was updated successfully, but these errors were encountered: