You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior: it detects an error on the last line of my spec because null is an invalid default value for an attribute of type array which does not have nullable: true
Because according to the OAS spec (https://swagger.io/docs/specification/data-models/keywords/ ) :
default– the default value must conform to the specified schema.
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Describe the bug you're encountering
null
is an invaliddefault
value for an attribute of typearray
which does not havenullable: true
Because according to the OAS spec (https://swagger.io/docs/specification/data-models/keywords/ ) :
To reproduce...
Steps to reproduce the behavior:
Expected behavior
An error saying that the default value cannot be null, is detected
Screenshots
As shown on this screenshot: in practice I don't have any error
Additional context or thoughts
FTR: OpenApiGenerator does detect that error: when I run OpenApiGenerator CLI like this
it fails with message
The text was updated successfully, but these errors were encountered: