diff --git a/src/schemas/validation/schema.yaml b/src/schemas/validation/schema.yaml index bfa2fcf3ea..b728cbfb98 100644 --- a/src/schemas/validation/schema.yaml +++ b/src/schemas/validation/schema.yaml @@ -951,6 +951,10 @@ $defs: type: object additionalProperties: $ref: '#/$defs/example-or-reference' + not: + required: + - example + - examples map-of-strings: type: object diff --git a/tests/schema/fail/example-examples.yaml b/tests/schema/fail/example-examples.yaml new file mode 100644 index 0000000000..97adcadba6 --- /dev/null +++ b/tests/schema/fail/example-examples.yaml @@ -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: + value: bear + + +