You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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: contact@example.com
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
The text was updated successfully, but these errors were encountered:
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
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 defaulttag-description
is turned off andoperation-operationId
is turned on)and a
ruleset.yaml
like this:with the following test OpenAPI document in
api.yaml
When running
npx spectral lint api.yaml -r ruleset.yaml
the result is:Expected behavior
Since in
base.yaml
the ruletag-description
is turned ON, I'd expect the command above to fail on the missing tag description. Please note that on the other handoperation-operationId: off
does work (the example above missedoperationId
so without explicitly turning it off the command should fail).Environment (remove any that are not applicable):
The text was updated successfully, but these errors were encountered: