daveshanley / vacuum

vacuum is the worlds fastest OpenAPI 3, OpenAPI 2 / Swagger linter and quality analysis tool. Built in go, it tears through API specs faster than you can think. vacuum is compatible with Spectral rulesets and generates compatible reports.
https://quobix.com/vacuum
MIT License
488 stars 39 forks source link

$ref looks not supported on path #422

Closed LasneF closed 5 months ago

LasneF commented 5 months ago

given the pattern below

paths: /orders: $ref: paths/orders.yaml

it looks not supported as giving me the below error \openapi.yaml:33:11 | error | schema invalid: not allowed | oas3-schema | Schemas | $.paths['/orders'].$ref .\openapi.yaml:35:11 | error | schema invalid: not allowed | oas3-schema | Schemas | $.paths['/orders/{order-id}'].$ref

BUT this pattern is valid according to OAS https://spec.openapis.org/oas/latest.html#fixed-fields-6

it should be managed as any $ref

daveshanley commented 5 months ago

oh dear, this error comes from here: https://github.com/OAI/OpenAPI-Specification/blob/main/schemas/v3.1/schema.json, its not something I can control, this rule is parsing the schema and validating it. I think the schema needs updating to allow it.

daveshanley commented 5 months ago

Looking deeper into this: Here is when the schema validator pulls out when validating against the latest 3.1 schema:

Screenshot 2024-01-19 at 12 42 43 PM

It's pointing here: https://github.com/OAI/OpenAPI-Specification/blob/main/schemas/v3.1/schema.yaml#L211

LasneF commented 5 months ago

good raising the topic to the OAS community

LasneF commented 5 months ago

this will be addressed when this will be merged / fixed https://github.com/OAI/OpenAPI-Specification/pull/3355

daveshanley commented 5 months ago

The latest OpenAPI 3.1 schema has been added into libopenapi and absorbed by vacuum in v0.8.7 and this issue is now resolved.