Skip to content

Commit 64d3360

Browse files
Restored src/* and tests/*
1 parent 6a655d6 commit 64d3360

28 files changed

+1253
-194
lines changed

src/oas.md

Lines changed: 313 additions & 153 deletions
Large diffs are not rendered by default.

src/schemas/validation/schema.yaml

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ properties:
1212
$ref: '#/$defs/info'
1313
jsonSchemaDialect:
1414
type: string
15-
format: uri
15+
format: uri-reference
1616
default: 'https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS'
1717
servers:
1818
type: array
@@ -64,7 +64,7 @@ $defs:
6464
type: string
6565
termsOfService:
6666
type: string
67-
format: uri
67+
format: uri-reference
6868
contact:
6969
$ref: '#/$defs/contact'
7070
license:
@@ -85,7 +85,7 @@ $defs:
8585
type: string
8686
url:
8787
type: string
88-
format: uri
88+
format: uri-reference
8989
email:
9090
type: string
9191
format: email
@@ -102,7 +102,7 @@ $defs:
102102
type: string
103103
url:
104104
type: string
105-
format: uri
105+
format: uri-reference
106106
required:
107107
- name
108108
dependentSchemas:
@@ -193,7 +193,7 @@ $defs:
193193
additionalProperties:
194194
$ref: '#/$defs/path-item'
195195
patternProperties:
196-
'^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$':
196+
'^(?:schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$':
197197
$comment: Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected
198198
propertyNames:
199199
pattern: '^[a-zA-Z0-9._-]+$'
@@ -297,7 +297,7 @@ $defs:
297297
type: string
298298
url:
299299
type: string
300-
format: uri
300+
format: uri-reference
301301
required:
302302
- url
303303
$ref: '#/$defs/specification-extensions'
@@ -341,8 +341,6 @@ $defs:
341341
properties:
342342
in:
343343
const: query
344-
required:
345-
- in
346344
then:
347345
properties:
348346
allowEmptyValue:
@@ -369,8 +367,6 @@ $defs:
369367
properties:
370368
in:
371369
const: path
372-
required:
373-
- in
374370
then:
375371
properties:
376372
style:
@@ -389,8 +385,6 @@ $defs:
389385
properties:
390386
in:
391387
const: header
392-
required:
393-
- in
394388
then:
395389
properties:
396390
style:
@@ -402,8 +396,6 @@ $defs:
402396
properties:
403397
in:
404398
const: query
405-
required:
406-
- in
407399
then:
408400
properties:
409401
style:
@@ -422,8 +414,6 @@ $defs:
422414
properties:
423415
in:
424416
const: cookie
425-
required:
426-
- in
427417
then:
428418
properties:
429419
style:
@@ -504,7 +494,6 @@ $defs:
504494
additionalProperties:
505495
$ref: '#/$defs/header-or-reference'
506496
style:
507-
default: form
508497
enum:
509498
- form
510499
- spaceDelimited
@@ -513,8 +502,22 @@ $defs:
513502
explode:
514503
type: boolean
515504
allowReserved:
516-
default: false
517505
type: boolean
506+
dependentSchemas:
507+
style:
508+
properties:
509+
allowReserved:
510+
default: false
511+
explode:
512+
properties:
513+
style:
514+
default: form
515+
allowReserved:
516+
default: false
517+
allowReserved:
518+
properties:
519+
style:
520+
default: form
518521
allOf:
519522
- $ref: '#/$defs/specification-extensions'
520523
- $ref: '#/$defs/styles-for-form'
@@ -598,7 +601,7 @@ $defs:
598601
value: true
599602
externalValue:
600603
type: string
601-
format: uri
604+
format: uri-reference
602605
not:
603606
required:
604607
- value
@@ -630,7 +633,7 @@ $defs:
630633
requestBody: true
631634
description:
632635
type: string
633-
body:
636+
server:
634637
$ref: '#/$defs/server'
635638
oneOf:
636639
- required:
@@ -760,8 +763,6 @@ $defs:
760763
properties:
761764
type:
762765
const: apiKey
763-
required:
764-
- type
765766
then:
766767
properties:
767768
name:
@@ -780,8 +781,6 @@ $defs:
780781
properties:
781782
type:
782783
const: http
783-
required:
784-
- type
785784
then:
786785
properties:
787786
scheme:
@@ -810,8 +809,6 @@ $defs:
810809
properties:
811810
type:
812811
const: oauth2
813-
required:
814-
- type
815812
then:
816813
properties:
817814
flows:
@@ -824,13 +821,11 @@ $defs:
824821
properties:
825822
type:
826823
const: openIdConnect
827-
required:
828-
- type
829824
then:
830825
properties:
831826
openIdConnectUrl:
832827
type: string
833-
format: uri
828+
format: uri-reference
834829
required:
835830
- openIdConnectUrl
836831

@@ -864,10 +859,10 @@ $defs:
864859
properties:
865860
authorizationUrl:
866861
type: string
867-
format: uri
862+
format: uri-reference
868863
refreshUrl:
869864
type: string
870-
format: uri
865+
format: uri-reference
871866
scopes:
872867
$ref: '#/$defs/map-of-strings'
873868
required:
@@ -881,10 +876,10 @@ $defs:
881876
properties:
882877
tokenUrl:
883878
type: string
884-
format: uri
879+
format: uri-reference
885880
refreshUrl:
886881
type: string
887-
format: uri
882+
format: uri-reference
888883
scopes:
889884
$ref: '#/$defs/map-of-strings'
890885
required:
@@ -898,10 +893,10 @@ $defs:
898893
properties:
899894
tokenUrl:
900895
type: string
901-
format: uri
896+
format: uri-reference
902897
refreshUrl:
903898
type: string
904-
format: uri
899+
format: uri-reference
905900
scopes:
906901
$ref: '#/$defs/map-of-strings'
907902
required:
@@ -915,13 +910,13 @@ $defs:
915910
properties:
916911
authorizationUrl:
917912
type: string
918-
format: uri
913+
format: uri-reference
919914
tokenUrl:
920915
type: string
921-
format: uri
916+
format: uri-reference
922917
refreshUrl:
923918
type: string
924-
format: uri
919+
format: uri-reference
925920
scopes:
926921
$ref: '#/$defs/map-of-strings'
927922
required:
@@ -951,6 +946,10 @@ $defs:
951946
type: object
952947
additionalProperties:
953948
$ref: '#/$defs/example-or-reference'
949+
not:
950+
required:
951+
- example
952+
- examples
954953

955954
map-of-strings:
956955
type: object
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
openapi: 3.1.1
2+
3+
# this example should fail, as example cannot be used together with examples.
4+
5+
info:
6+
title: API
7+
version: 1.0.0
8+
components:
9+
parameters:
10+
animal:
11+
name: animal
12+
in: header
13+
schema: {}
14+
example: bear
15+
examples:
16+
a mammalian example:
17+
value: bear

tests/schema/fail/invalid_schema_types.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ components:
1010
invalid_null: null
1111
invalid_number: 0
1212
invalid_array: []
13-
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
openapi: 3.1.0
2+
info:
3+
title: API
4+
version: 1.0.0
5+
components:
6+
links:
7+
Link-Object-with-body-property:
8+
operationId: getThing
9+
description: The "server" property was misspelled as "body" in a previous schema iteration, now fixed
10+
body:
11+
url: https://things.example.com
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
openapi: 3.1.0
2+
info:
3+
title: API
4+
version: 1.0.0
5+
components:
6+
callbacks:
7+
myCallback:
8+
'{$request.query.queryUrl}':
9+
post:
10+
requestBody:
11+
description: Callback payload
12+
content:
13+
application/json:
14+
schema:
15+
$ref: '#/components/schemas/SomePayload'
16+
responses:
17+
'200':
18+
description: callback successfully processed
19+
transactionCallback:
20+
'http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}':
21+
post:
22+
requestBody:
23+
description: Callback payload
24+
content:
25+
application/json:
26+
schema:
27+
$ref: '#/components/schemas/SomePayload'
28+
responses:
29+
'200':
30+
description: callback successfully processed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
openapi: 3.1.0
2+
info:
3+
title: API
4+
version: 1.0.0
5+
components:
6+
schemas:
7+
GeneralError:
8+
type: object
9+
properties:
10+
code:
11+
type: integer
12+
format: int32
13+
message:
14+
type: string
15+
Category:
16+
type: object
17+
properties:
18+
id:
19+
type: integer
20+
format: int64
21+
name:
22+
type: string
23+
Tag:
24+
type: object
25+
properties:
26+
id:
27+
type: integer
28+
format: int64
29+
name:
30+
type: string
31+
parameters:
32+
skipParam:
33+
name: skip
34+
in: query
35+
description: number of items to skip
36+
required: true
37+
schema:
38+
type: integer
39+
format: int32
40+
limitParam:
41+
name: limit
42+
in: query
43+
description: max records to return
44+
required: true
45+
schema:
46+
type: integer
47+
format: int32
48+
responses:
49+
NotFound:
50+
description: Entity not found.
51+
IllegalInput:
52+
description: Illegal input for operation.
53+
GeneralError:
54+
description: General Error
55+
content:
56+
application/json:
57+
schema:
58+
$ref: '#/components/schemas/GeneralError'
59+
securitySchemes:
60+
api_key:
61+
type: apiKey
62+
name: api-key
63+
in: header
64+
petstore_auth:
65+
type: oauth2
66+
flows:
67+
implicit:
68+
authorizationUrl: https://example.org/api/oauth/dialog
69+
scopes:
70+
write:pets: modify pets in your account
71+
read:pets: read your pets

0 commit comments

Comments
 (0)