-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Error: "nullable" cannot be used without "type" #228
Comments
Just dropping this here: OAI/OpenAPI-Specification#1368 Might be a feature 'support openapi 3.1' |
FWIW - I'm using OpenAPI Backend to implement an application using a spec developed by a standards organization. They recently switched to using
Commenting out all uses of Some examples: x:
type: number
format: float
description: A value on an x axis.
example: 1.0
# nullable: true
default: null
targets:
type: array
description: An list of target objects.
# nullable: true
default: null
items:
$ref: '#/components/schemas/target'
userIdentifier:
oneOf: [
{type: integer},
{type: string}
]
description: User generated numeric or string identifier
example: 99
# nullable: true
default: null
programDescriptions:
type: array
description: A list of programDescriptions
# nullable: true
default: null
items:
required:
- URL
properties:
URL:
type: string
# format: uri
description: a human or machine readable program description
example: www.myCorporation.com/myProgramDescription The last one also demonstrates another unrelated issue - that |
I'm generating the following yaml spec file with openapi 3.0.0 from my kotlin backend:
The interesting part here is this
field4
which may be a nulllable reference.After that I try to write a test and mock this API:
Expected behaviour: Api is initialized
Actual behaviour:
Error: "nullable" cannot be used without "type"
What I tried so far:
openapi-backend
4.1.0
and4.2.0
I tried to replace
with
And it helps but I don't won't to do it manually, I would like to rely on automatic schema generation. Any ideas what I'm doing wrong? As far as I understand the schema is valid, why I cannot generate an API mock from it?
The text was updated successfully, but these errors were encountered: