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 The oas validation fails when the default property is set as an object property, but it doesn't cover all the required values:
default
required
38:15 error oas3-valid-schema-example "default" property must have required property "count" components.schemas.Foo.default.
38:15 error oas3-valid-schema-example "default" property must have required property "count" components.schemas.Foo.default
To Reproduce
api.yaml
openapi: 3.0.3 info: title: Sample API version: 0.1.0 paths: /test: post: requestBody: description: Optional description in *Markdown* required: true content: application/json: schema: $ref: '#/components/schemas/Foo' responses: "200": # status code description: Sample response content: application/json: schema: type: array items: type: string components: schemas: Foo: type: object properties: name: type: string count: type: integer required: - name - count default: # <--- Failing because 'default' doesn't contain the 'count' property that is required name: foo
.spectral.yaml
extends: ["spectral:oas"]
spectral lint api.yaml
Expected behavior The validation should pass since it is compliant with the json schema validation and the oas specification.
Environment:
Additional context The validation works fine for the given OpenAPI document using the swagger editor online.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
The oas validation fails when the
default
property is set as an object property, but it doesn't cover all therequired
values:38:15 error oas3-valid-schema-example "default" property must have required property "count" components.schemas.Foo.default
.To Reproduce
api.yaml
.spectral.yaml
spectral lint api.yaml
38:15 error oas3-valid-schema-example "default" property must have required property "count" components.schemas.Foo.default
Expected behavior
The validation should pass since it is compliant with the json schema validation and the oas specification.
Environment:
Additional context
The validation works fine for the given OpenAPI document using the swagger editor online.
The text was updated successfully, but these errors were encountered: