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 needs a schema property to be supplied at a minimum: minimum property number not met (1) #507

Open
ShepleySound opened this issue Jun 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ShepleySound
Copy link

I've defined the following ruleset:

extends: [[spectral:oas, recommended]]
rules:
  test-json-schema:
    type: validation
    description: "Test"
    message: "Test Message"
    howToFix: "TestHowToFix"
    given: $.paths[*][*]
    severity: error
    then:
      field: "tags"
      function: "schema"
      functionOptions:
        schema:
          type: "array"
          contains:
            pattern: "^(user|admin)$"
          minContains: 1
          maxContains: 1

All Vacuum reports, regardless of schema, are returning a validation error:

schema function needs a schema property to be supplied at a minimum: minimum property number not met (1)

I've tried this with multiple variations to the schema property of functionOptions, and all of them return the same error message, so this seems to be related to the MinProperties check that was added in 0.10.0.

@daveshanley
Copy link
Owner

Hmm... will look into this for you, not sure what is going on but something looks off.

@daveshanley daveshanley added the bug Something isn't working label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants