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
Describe the bug
oas3-valid-media-example doesn't flag the stray field provided in the media example as an error
To Reproduce
Given this OpenAPI/AsyncAPI document (name.yaml)
openapi: 3.0.0info:
title: Sample APIversion: 1.0.0description: Sample OpenAPI Spec with a Schemapaths:
/sample:
get:
summary: Get Sample Dataresponses:
'200':
description: Successful responsecontent:
application/json:
schema:
$ref: '#/components/schemas/SampleSchema'example:
name: null # this is caught by the spectral ruledateOfBirth: 1990-01-01status: test # this not caught by the spectral rule until the first error (name) is fixedage: 12# this does not exist in the schemacomponents:
schemas:
SampleSchema:
type: objectproperties:
name:
type: stringexample: John DoedateOfBirth:
type: stringformat: dateexample: 1990-01-01status:
type: stringenum:
- active
- inactiveexample: active
the following spectral rule: (.spectral.yml)
extends: spectral:oas
Run this CLI command '....'
spectral lint --ruleset=.spectral.yml name.yaml
Expected behavior
The rule should flag the stray field provided in the example (i.e age) since it does not exist in the schema
If an example is bad, it stops at the first bad example and doesn't process others until you fix it. I believe it should catch all instead of fail on first for example evaluation
Environment (remove any that are not applicable):
Spectral version 6.5.0
OS: Darwin/Mac
The text was updated successfully, but these errors were encountered:
Describe the bug
oas3-valid-media-example doesn't flag the stray field provided in the media example as an error
To Reproduce
Expected behavior
example
(i.eage
) since it does not exist in the schemaEnvironment (remove any that are not applicable):
The text was updated successfully, but these errors were encountered: