Skip to content
New issue

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

allow vendor extensions next to $refs #586

Open
BentEngbers opened this issue Nov 22, 2024 · 1 comment
Open

allow vendor extensions next to $refs #586

BentEngbers opened this issue Nov 22, 2024 · 1 comment

Comments

@BentEngbers
Copy link

In the following example, vacuum reports an oas3-no-$ref-siblings error.

openapi: 3.1.0
paths:
  /example:
    get:
      operationId: example
      responses:
        "200":
          content:
            application/json:
              schema:
                x-test: foo
                $ref: "#/components/schemas/response"
components:
  schemas:
    response:
      type: string

The error:

 a `$ref` can only be placed next to `summary` and `description` but got:x-test      | oas3-no-$ref-siblings
@LasneF
Copy link

LasneF commented Nov 25, 2024

looking on the rules here
https://learn.openapis.org/referencing/overview.html#a-taxonomy-of-references

summary and description has an explicit specification , whereas it has not for extension

the key being if the reference should override the parent or not , this behavior is only specified for description and summary

then to me the rule as it is looks fair ,

2 options for work around :
@BentEngbers disable the rules as it does not suits your need
@daveshanley having a mechanism of rules extension so that the end user can add others key word to the rules (may be simple to say , but complex to specify with dedicated configuration file/ model )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants