Skip to content

oas3-schema rule returning invalid error for $ref in path-items #388

@TristanSpeakEasy

Description

@TristanSpeakEasy

So looks like libopenapi-validator is wrapping github.com/santhosh-tekuri/jsonschema/v5 and cleaning up the errors but it is hiding which schema is being used to validate the json schema (which would be useful information to expose I think), anyway after debugging I thought it was using json schema 2022-10 instead of 2020-12 but that was a red herring (https://spec.openapis.org/oas/3.1/schema/2022-10-07 links to json schema https://json-schema.org/draft/2020-12/schema internally)

Anyway either this schema is wrong or github.com/santhosh-tekuri/jsonschema/v5 is handling it wrong but a path item like:

  /test2/org/{org}/team/{team}:
    $ref: "./paths.yaml#/test-2"

is causing this error to be shown:

oas3-schema - Schema: not allowed | $.paths['/test2/org/{org}/team/{team}'].$ref

but according to the specification https://spec.openapis.org/oas/v3.1.0#pathItemRef a $ref in a path item is entirely valid.

Not sure who we need to chase (is it the openapi committee or the jsonschema library maintainer? maybe both) but thought I would document this issue here to start with

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions