-
Notifications
You must be signed in to change notification settings - Fork 536
Closed
Description
The following definition is invalid..
openapi: 3.0.3
info:
title: Missing validation rule for schemas in Headers.
version: 1.0.0
paths:
/foo:
get:
description: ok
parameters:
- $ref: '#/components/schemas/xFoo'
responses:
default:
description: ok
headers:
three:
$ref: '#/components/schemas/xFoo'
components:
schemas:
xFoo:
type: string
description: This isn't validated correctly
In it the parameter (and header) are both referencing #/components/schemas/xFoo, and xFoo isn't a valid header/paramter. A valid would header/parameter needs the schema property, e.g.:
xFoo:
schema:
type: string
description: This is a valid headerTested with https://validator.swagger.io (in case there is a discrepency).
Is there a decision to not validate the fully resolved definition? Or a decision to validate against improper paths (i.e., referencing a JSON Pointer that looks fishy, even if technically it's allowed by the spec to reference any path).
Metadata
Metadata
Assignees
Labels
No labels