We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Description
boolean true/false are valid JsonSchemas and represents respectively "everything is valid" / "nothing is valid".
true
false
when openapi-typescript encounters one (e.g. {"properties": {"foo": true}} it produces foo: true instead of foo: unknown in the corresponding type
{"properties": {"foo": true}}
foo: true
foo: unknown
openapi-typescript
6.3.4
v18.15.0
macOS
Reproduction
minimal-api.json:
{ "openapi": "3.1.0", "servers": [ { "url": "" } ], "info": { "title": "API", "version": "" }, "paths": { }, "components": { "schemas": { "Foo": { "type": "object", "properties": { "works": { }, "fails": true } } } } }
$ npx openapi-typescript minimal-api.json:
$ npx openapi-typescript minimal-api.json
/** * This file was auto-generated by openapi-typescript. * Do not make direct changes to the file. */ export type paths = Record<string, never>; export type webhooks = Record<string, never>; export interface components { schemas: { Foo: { works?: unknown; fails?: true; }; }; responses: never; parameters: never; requestBodies: never; headers: never; pathItems: never; } export type external = Record<string, never>; export type operations = Record<string, never>;
Expected result
.... Foo: { works?: unknown; fails?: unknown; <-- here }; ....
also false should either produce : never or omit the property
: never
Checklist
npx @redocly/cli@latest lint
NOTE: redocly fails expecting an object in that position, but both the JsonSchema spec and other validators online (like this) say it's valid
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Description
boolean
true
/false
are valid JsonSchemas and represents respectively "everything is valid" / "nothing is valid".when openapi-typescript encounters one (e.g.
{"properties": {"foo": true}}
it producesfoo: true
instead offoo: unknown
in the corresponding typeopenapi-typescript
6.3.4
v18.15.0
macOS
Reproduction
minimal-api.json:
$ npx openapi-typescript minimal-api.json
:Expected result
also
false
should either produce: never
or omit the propertyChecklist
npx @redocly/cli@latest lint
)NOTE: redocly fails expecting an object in that position, but both the JsonSchema spec and other validators online (like this) say it's valid
The text was updated successfully, but these errors were encountered: