Open
Description
Describe the bug
The no-security-schemes-defined rule seems to incorrectly match non-root components objects, resulting in false positives.
To Reproduce
Given this openapi.yml
document:
openapi: '3.1.0'
info:
title: TITLE
version: 'VERSION'
paths: {}
components:
schemas:
Foo:
type: object
properties:
components:
type: number
securitySchemes:
sec:
type: http
scheme: bearer
Run this CLI command:
$ spectral lint openapi.yml
[...]
13:20 error no-security-schemes-defined All APIs MUST have a security scheme defined. components.schemas.Foo.properties.components
Expected behavior
The rule should not match, i.e the behavior should be the same as when renaming the components
property of the above Foo schema to component
.
Environment
- Library version: 6.14.2
Activity