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
Describe the bug
When a schema has type null defined in YAML, it is being treated as a null value and not "null" the string that defines the types.
null
https://json-schema.org/understanding-json-schema/reference/null.html
https://github.com/Redocly/openapi-starter/blob/main/openapi/components/schemas/Schema.yaml#L41
I believe that Schema needs to be adjusted to the following to define the type properly:
nullableOrStringProperty: description: Property name's description (type is string or null) type: - string - "null"
However, I then suspected that nothing in the type list is being validated:
Redocly/openapi-starter#74
This bug does not exist when type is defined as a string (for example the following would produce a problem):
type: foo
To Reproduce Steps to reproduce the behavior:
Expected behavior
problem message:
type can be one of the following only: "object", "array", "string", "number", "integer", "boolean", "null".
type
Logs
There is no problem detected (which is the problem because there is a problem).
OpenAPI definition
OAS 3.1 https://github.com/Redocly/openapi-starter/blob/main/openapi/components/schemas/Schema.yaml#L41
Redocly Version(s)
1.0.0-beta.108
Node.js Version(s)
Node.js
16.10
Additional context
The text was updated successfully, but these errors were encountered:
Hmm, interesting, so my schema is invalid? null needs to always be defined as a string? Why?
allOf: - type: object properties: car: $ref: ./Car.yaml user: type: - object - null $ref: ./User.yaml user_id: type: - integer - null car_id: type: - integer - null
This was not triggering an error on 1.0.0-beta.125, but it does now.
1.0.0-beta.125
Sorry, something went wrong.
IgorKarpiuk
Successfully merging a pull request may close this issue.
Describe the bug
When a schema has type
null
defined in YAML, it is being treated as a null value and not "null" the string that defines the types.https://json-schema.org/understanding-json-schema/reference/null.html
https://github.com/Redocly/openapi-starter/blob/main/openapi/components/schemas/Schema.yaml#L41
I believe that Schema needs to be adjusted to the following to define the type properly:
However, I then suspected that nothing in the type list is being validated:
Redocly/openapi-starter#74
This bug does not exist when type is defined as a string (for example the following would produce a problem):
To Reproduce
Steps to reproduce the behavior:
Expected behavior
problem message:
Logs
There is no problem detected (which is the problem because there is a problem).
OpenAPI definition
OAS 3.1
https://github.com/Redocly/openapi-starter/blob/main/openapi/components/schemas/Schema.yaml#L41
Redocly Version(s)
1.0.0-beta.108
Node.js
Version(s)16.10
Additional context
The text was updated successfully, but these errors were encountered: