Skip to content

Commit caabbf8

Browse files
committed
Merge remote-tracking branch 'upstream/v3.2-dev' into 3.2-schema-coverage
2 parents 566eec4 + 774f70c commit caabbf8

10 files changed

+484
-63
lines changed

src/oas.md

Lines changed: 373 additions & 54 deletions
Large diffs are not rendered by default.

src/schemas/validation/schema.yaml

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ $defs:
370370
- required:
371371
- content
372372
allOf:
373+
- $ref: '#/$defs/examples'
374+
- $ref: '#/$defs/specification-extensions'
373375
- if:
374376
properties:
375377
in:
@@ -407,7 +409,6 @@ $defs:
407409
default: false
408410
type: boolean
409411
allOf:
410-
- $ref: '#/$defs/examples'
411412
- $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path'
412413
- $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-header'
413414
- $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-query'
@@ -478,7 +479,6 @@ $defs:
478479
default: form
479480
const: form
480481

481-
$ref: '#/$defs/specification-extensions'
482482
unevaluatedProperties: false
483483

484484
parameter-or-reference:
@@ -539,9 +539,20 @@ $defs:
539539
type: object
540540
additionalProperties:
541541
$ref: '#/$defs/encoding'
542+
prefixEncoding:
543+
type: array
544+
items:
545+
$ref: '#/$defs/encoding'
546+
itemEncoding:
547+
$ref: '#/$defs/encoding'
542548
allOf:
543-
- $ref: '#/$defs/specification-extensions'
544549
- $ref: '#/$defs/examples'
550+
- $ref: '#/$defs/specification-extensions'
551+
- dependentSchemas:
552+
encoding:
553+
properties:
554+
prefixEncoding: false
555+
itemEncoding: false
545556
unevaluatedProperties: false
546557

547558
media-type-or-reference:
@@ -672,14 +683,30 @@ $defs:
672683
type: string
673684
description:
674685
type: string
686+
dataValue: true
687+
serializedValue:
688+
type: string
675689
value: true
676690
externalValue:
677691
type: string
678692
format: uri-reference
679-
not:
680-
required:
681-
- value
682-
- externalValue
693+
allOf:
694+
- not:
695+
required:
696+
- value
697+
- externalValue
698+
- not:
699+
required:
700+
- value
701+
- dataValue
702+
- not:
703+
required:
704+
- value
705+
- serializedValue
706+
- not:
707+
required:
708+
- serializedValue
709+
- externalValue
683710
$ref: '#/$defs/specification-extensions'
684711
unevaluatedProperties: false
685712

@@ -763,7 +790,9 @@ $defs:
763790
default: false
764791
type: boolean
765792
$ref: '#/$defs/examples'
766-
$ref: '#/$defs/specification-extensions'
793+
allOf:
794+
- $ref: '#/$defs/examples'
795+
- $ref: '#/$defs/specification-extensions'
767796
unevaluatedProperties: false
768797

769798
header-or-reference:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
openapi: 3.2.0
2+
info:
3+
title: API
4+
version: 1.0.0
5+
6+
components:
7+
examples:
8+
CannotHaveBoth:
9+
value: foo
10+
externalValue: https://example.com/foo
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
openapi: 3.2.0
2+
info:
3+
title: API
4+
version: 1.0.0
5+
6+
components:
7+
examples:
8+
NoValueWithDataValue:
9+
value: foo
10+
dataValue: foo
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
openapi: 3.2.0
2+
info:
3+
title: API
4+
version: 1.0.0
5+
6+
components:
7+
examples:
8+
CannotHaveBoth:
9+
value: foo
10+
serializedValue: foo
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
openapi: 3.2.0
2+
info:
3+
title: API
4+
version: 1.0.0
5+
6+
components:
7+
examples:
8+
CannotHaveBoth:
9+
serializedValue: foo
10+
externalValue: https://example.com/foo
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
openapi: 3.2.0
2+
info:
3+
title: API
4+
version: 1.0.0
5+
components:
6+
requestBodies:
7+
encoding-with-itemEncoding-not-allowed:
8+
content:
9+
multipart/mixed:
10+
encoding: {}
11+
itemEncoding: {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
openapi: 3.2.0
2+
info:
3+
title: API
4+
version: 1.0.0
5+
components:
6+
requestBodies:
7+
encoding-with-prefixEncoding-not-allowed:
8+
content:
9+
multipart/mixed:
10+
encoding: {}
11+
prefixEncoding: []

tests/schema/pass/example-object-examples.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,5 @@ components:
6060
examples:
6161
jsonFormValue:
6262
description: 'The JSON string "json" as a form value'
63-
value: jsonValue=%22json%22
63+
dataValue: json
64+
serializedValue: jsonValue=%22json%22

tests/schema/pass/media-type-examples.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,13 @@ paths:
161161
prefixEncoding:
162162
- {}
163163
itemEncoding: {}
164+
multipart/related:
165+
schema:
166+
type: array
167+
itemEncoding:
168+
contentType: text/plain
169+
prefixEncoding:
170+
- headers:
171+
Content-Location:
172+
schema:
173+
type: string

0 commit comments

Comments
 (0)