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

Unable to lint open api if it is wrapped by object #2621

Open
school-coder opened this issue May 14, 2024 · 0 comments
Open

Unable to lint open api if it is wrapped by object #2621

school-coder opened this issue May 14, 2024 · 0 comments
Labels
enhancement New feature or request triaged

Comments

@school-coder
Copy link

Describe the bug
When openapi is wrapped in a object ( JSON or YAML), extends: [spectral:oas] is not able to be reused.

To Reproduce

  1. Given this document,
    image
    spec attribute needs to comply with spectral:oas ruleset.

  2. When i try to start the node js server, with the below rule,
    image

I am getting the following error

RulesetValidationError: the rule must have at least "given" and "then" properties

Expected behavior
When a rule extends a certain rule set (as we have done for 'spectral:oas' for 'spec' attribute) for a given attribute, linting needs to be done for that attribute and corresponding linting responses needs to be provided. 'then' must be optional if 'extends' is provided.

@mnaumanali94 mnaumanali94 added the enhancement New feature or request label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triaged
Projects
None yet
Development

No branches or pull requests

2 participants