Open onavratil-monetplus opened 1 week ago
The typing is not defined in the Oas3_1.ts of the core package. You're welcome to send a PR to add this keyword to the Schema
type definition after this line
https://github.com/Redocly/redocly-cli/blob/2bfef43b8ab0656141fa52977bf8303cd323aa96/packages/core/src/types/oas3_1.ts#L171-L172
contentSchema: 'Schema',
Describe the bug
The bundle utility does not recognize references within
contentSchema
For example:
The resulting bundled file will still contain the original
$ref: some-model.yaml
- the reference will neither be unfolded nor added tocomponents/schemas
or so.To Reproduce Steps to reproduce the behavior:
This OpenAPI file(s)
The contents of
some-model.yaml
are irrelevant (redocly will not do anything with the file), but to make the original schema valid, lets consider it contains something like this:The $ref stays there, but is not unfolded into components
Expected behavior
$ref will be resolved and bundled
Redocly Version(s)
Node.js
Version(s)Additional context
These keywords are part of 2019 draft and OAS 3.1.0 references 2020-12 draft of JSON schema; thus compliance with OAS 3.1, which redocly proclaims, should include this behavior.
I know that redoc as such does not visualize
contentSchema
in the generated html, but e.g.contentMediaType
andcontentEncoding
are somehow supported. Moreover, the resulting bundled specs (which is also downloadable from the standalone html) is formally invalid because of the missing reference, and thus may cause problems with other tooling that resolve and utilizecontentSchema
references.