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

lint --fail-severity parameters missing in documentation #377

Closed
mazumba-nx opened this issue Nov 28, 2023 · 3 comments
Closed

lint --fail-severity parameters missing in documentation #377

mazumba-nx opened this issue Nov 28, 2023 · 3 comments

Comments

@mazumba-nx
Copy link

I am using the docker container dshanley/vacuum:v0.5.1 in a github workflow to check for OpenAPI errors.
The command is vacuum lint apidoc.yaml --no-style --fail-severity warning and should return Error 1 when warnings or errors are thrown.

When using the lint command with a file having errors and warnings, the command only exits with Error 1 when either

  • use --fail-severity error (or using the default)
  • use --fail-severity info

When using --fail-severity warning, the command displays the errors and warnings but still returns successfully.
Here is an example yaml with an error and a couple warnings.

openapi: 3.0.0
info:
  title: 'An Example API'
  description: 'Provide an example for an issue'
  version: 1.0.0
servers:
  -
    url: /api
paths:
  '/api/foo/{id}/bar':
    get:
      tags:
        - Foo
      description: 'Lists orders'
      parameters:
        -
          name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'The list of Bars'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Bar'
components:
  schemas:
    Bar:
      properties:
        id:
          type: string
      type: object

I think there is a warning key missing somewhere in the code.

Hope this helps! Thank you!

@mazumba-nx
Copy link
Author

After thinking "maybe I can resolve this and create a PR" I found, that the correct parameter is warn and not warning. So no Bug here!

This is not clear from the documentation though. https://quobix.com/vacuum/commands/lint/

Could you include the three possibilities error, warn and info to the list?

@mazumba-nx mazumba-nx changed the title lint --fail-severity warning does not exit with Error 1 lint --fail-severity parameters missing in documentation Nov 28, 2023
@ajoga
Copy link

ajoga commented Dec 5, 2023

+1 :) this echoes #367 (comment)

daveshanley added a commit that referenced this issue Dec 13, 2023
As I was cleaning up the docs, I noticed that a `version` command would go down well.

Signed-off-by: quobix <dave@quobix.com>
daveshanley added a commit that referenced this issue Dec 13, 2023
As I was cleaning up the docs, I noticed that a `version` command would go down well.

Signed-off-by: quobix <dave@quobix.com>
@daveshanley
Copy link
Owner

A new version command is available in v0.6.0

https://quobix.com/vacuum/commands/version/

Also the docs for the --fail-severity flag has been properly documented.

https://quobix.com/vacuum/commands/lint/#fail-severity

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

3 participants