Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/schemas/validation/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,10 @@ $defs:
type: object
additionalProperties:
$ref: '#/$defs/example-or-reference'
not:
required:
- example
- examples

map-of-strings:
type: object
Expand Down
20 changes: 20 additions & 0 deletions tests/schema/fail/example-examples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
openapi: 3.1.1

# this example should fail, as example cannot be used together with examples.

info:
title: API
version: 1.0.0
components:
parameters:
animal:
name: animal
in: header
schema: {}
example: bear
examples:
a mammalian example:
dataValue: bear


Comment on lines +17 to +19
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dataValue: bear
value: bear