Closed razvanphp closed 5 months ago
:tada: This issue has been resolved in version 1.19.0 :tada:
The release is available on @stoplight/spectral-rulesets-1.19.0
Your semantic-release bot :package::rocket:
Thank you @mnaumanali94! How can I check from the CI what version of the rulesets I have installed?
I currently only have this:
$ spectral --version
6.11.1
Also, I just checked, and I think there is one more edge case with null
and 'null'
in the type that redocly catches:
[1] models/Config.yaml:18:13 at #/allOf/0/properties/user_id/type/1
`type` can be one of the following only: "object", "array", "string", "number", "integer", "boolean", "null".
Did you mean:
- object
- array
- string
- number
- integer
16 | type:
17 | - integer
18 | - null
19 | car_id:
20 | type:
Error was generated by the spec rule.
[2] models/Config.yaml:22:13 at #/allOf/0/properties/car_id/type/1
`type` can be one of the following only: "object", "array", "string", "number", "integer", "boolean", "null".
Did you mean:
- object
- array
- string
- number
- integer
20 | type:
21 | - integer
22 | - null
Schema looks like this:
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
See spec: https://json-schema.org/understanding-json-schema/reference/null
User story. As a user switching from redocly I noticed in our CI pipeline that some errors are not displayed anymore, here is a test yaml:
This is the output of spectral (with
extends: 'spectral:oas'
):No results with a severity of 'error' found!
but redocly shows obvious errors:
Is your feature request related to a problem? It might be; not sure why redocly uses more rules by default compared to spectral, but I'm inclined to think we should have those included even in the recommended ruleset.
Describe the solution you'd like Have the schema type validated by oas spec rules similar to redocly.
Additional context
Thank you in advance! R