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

schema function behavior inconsistent with equivalent spectral rule #490

Open
rspurgeon opened this issue May 1, 2024 · 0 comments
Open

Comments

@rspurgeon
Copy link

Attempting to use the schema function to validate an entire input file (non-OAS).

Given

❯ vacuum version
0.9.15
❯ spectral --version
6.11.1

rules.yaml

rules:
  check-only-consumers:
    description: "Ensure only consumer entities in state files"
    given: "$"
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          type: "object"
          properties:
            consumers: 
              type: "array"
          additionalProperties: false

consumers.yaml

consumers:
- username: mortgage-consumer-0
  custom_id: mortgage-consumer-0

consumers-bad.yaml

consumers:
- username: mortgage-consumer-0
  custom_id: mortgage-consumer-0
services:
  enabled: true

Spectral lint of consumers.yaml:

No results with a severity of 'error' found!

and for consumers-bad.yaml

 1:1  error  check-only-consumers  Ensure only consumer entities in state files

✖ 1 problem (1 error, 0 warnings, 0 infos, 0 hints)

the vacuum CLI reports no issues on either file:

INFO: Linting file 'consumers.yaml' against 1 rules:


Linting passed, A perfect score! well done!%

or

INFO: Linting file 'consumers-bad.yaml' against 1 rules:


Linting passed, A perfect score! well done!%
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

1 participant