Skip to content

Ignored errors show up when referenced elsewhere #620

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

Open
dirkhicke opened this issue Feb 12, 2025 · 2 comments
Open

Ignored errors show up when referenced elsewhere #620

dirkhicke opened this issue Feb 12, 2025 · 2 comments

Comments

@dirkhicke
Copy link

I'm getting inconsistent results when linting the following spec

openapi: 3.0.1
info:
  title: '[LOCAL] Microsoft ASP.NET Core'
paths:
  /test:
    get:
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
            text/plain:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    InvalidParameter:
      type: object
      properties:
        name:
          pattern: ^[a-zA-Z0-9]{0,20}$
          type: string
          nullable: true
        reasons:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        invalidParameters:
          type: array
          items:
            $ref: '#/components/schemas/InvalidParameter'
          nullable: true

with only owasp-string-restricted enabled and this ignore file

owasp-string-restricted:
  - $.components.schemas['InvalidParameter'].properties['reasons'].items

Most of the time linting passes but occasionally (1 out of 4 runs or so) it results in an error for path $.components.schemas['ProblemDetails'].properties['invalidParameters'].items.properties['reasons'].items or $.paths['/test'].get.responses['200'].content['text/json'].schema.properties['invalidParameters'].items.properties['reasons'].items or similar ones (paths where the ignored path is $ref'd).

Is there any way to work around this and only show errors for the component itself but not paths and components that reference the one with the error? Even showing the same error for all references every time would help.

@daveshanley
Copy link
Owner

Which version of vacuum are you using?

@dirkhicke
Copy link
Author

dirkhicke commented Feb 13, 2025

I've tried it with v0.16.2 downloaded with npm, as well as v0.14.0 and latest in docker. It's reproducible in all three versions.

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

No branches or pull requests

2 participants