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

Multiple extends with enabled extra rules does not work #1380

Closed
exoszajzbuk opened this issue Oct 14, 2020 · 4 comments · Fixed by #1465
Closed

Multiple extends with enabled extra rules does not work #1380

exoszajzbuk opened this issue Oct 14, 2020 · 4 comments · Fixed by #1465
Assignees
Labels
t/bug Something isn't working
Milestone

Comments

@exoszajzbuk
Copy link

When using multiple extends turning ON specific rules in the "base" ruleset does not work in the extended one, but turning rules OFF does.

To Reproduce

Have a base.yaml like this (where by default tag-description is turned off and operation-operationId is turned on)

extends: spectral:oas

rules:
  tag-description: true
  operation-operationId: off

and a ruleset.yaml like this:

extends: ./base.yaml

with the following test OpenAPI document in api.yaml

openapi: 3.0.0
servers:
  - description: Test API
    url: https://example.com/api
info:
  description: 'Test API'
  version: 1.0.0
  title: Test API
  contact:
    email: [email protected]
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
tags:
  - name: test                # !!! note tag not having description !!!
paths:
  /test:
    get:                      # !!! note endpoint not having operationId !!!
      tags:
        - test
      summary: 'Test Operation'
      description: 'Test Operation'
      responses:
        '200':
          description: successful operation

When running npx spectral lint api.yaml -r ruleset.yaml the result is:

OpenAPI 3.x detected
No results with a severity of 'error' or higher found!

Expected behavior

Since in base.yaml the rule tag-description is turned ON, I'd expect the command above to fail on the missing tag description. Please note that on the other hand operation-operationId: off does work (the example above missed operationId so without explicitly turning it off the command should fail).

Environment (remove any that are not applicable):

  • Library version: [e.g. 3.0.0] - 5.6.0
  • OS: [e.g. Windows 7] - macOS 10.15.6
@exoszajzbuk exoszajzbuk added the t/bug Something isn't working label Oct 14, 2020
@exoszajzbuk exoszajzbuk changed the title Multiple extends with enabled extra rules doest not work Multiple extends with enabled extra rules does not work Oct 14, 2020
@P0lip
Copy link
Contributor

P0lip commented Nov 1, 2020

Isn't this issue similar (or perhaps a duplicate) to #1352?

@exoszajzbuk
Copy link
Author

It is maybe connected, but definitely not a duplicate

@exoszajzbuk
Copy link
Author

any updates on this?

@P0lip
Copy link
Contributor

P0lip commented Jan 4, 2021

Hey @exoszajzbuk. No update yet. I can only confirm that the issue you raised is indeed valid and we're hoping to address the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants