File tree 5 files changed +54
-3
lines changed
5 files changed +54
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ The iteration version of the JSON Schema can be found in the `$id` field. For
13
13
example, the value of ` $id: https://spec.openapis.org/oas/3.1/schema/2021-03-02 `
14
14
means this iteration was created on March 2nd, 2021.
15
15
16
+ The ` schema.yaml ` schema doesn't validate the JSON Schemas in your OpenAPI
17
+ document because 3.1 allows you to use any JSON Schema dialect you choose. We
18
+ have also included ` schema-base.yaml ` that extends the main schema to validate
19
+ that all schemas use the default OAS base vocabulary.
20
+
21
+ ## Contributing
16
22
To submit improvements to the schema, modify the schema.yaml file only.
17
23
18
24
The TSC will then:
Original file line number Diff line number Diff line change
1
+ {
2
+ "$id" : " https://spec.openapis.org/oas/3.1/schema-full/2021-03-02" ,
3
+ "$schema" : " https://json-schema.org/draft/2020-12/schema" ,
4
+ "$ref" : " https://spec.openapis.org/oas/3.1/schema/2021-03-02" ,
5
+ "properties" : {
6
+ "jsonSchemaDialect" : {
7
+ "$ref" : " #/$defs/dialect"
8
+ }
9
+ },
10
+ "$defs" : {
11
+ "dialect" : {
12
+ "const" : " https://spec.openapis.org/oas/3.1/dialect/base"
13
+ },
14
+ "schema" : {
15
+ "$dynamicAnchor" : " meta" ,
16
+ "$ref\" " : " https://spec.openapis.org/oas/3.1/dialect/base" ,
17
+ "properties" : {
18
+ "$schema" : {
19
+ "$ref" : " #/$defs/dialect"
20
+ }
21
+ }
22
+ }
23
+ }
24
+ }
Original file line number Diff line number Diff line change
1
+ $id : ' https://spec.openapis.org/oas/3.1/schema-full/2021-03-02'
2
+ $schema : ' https://json-schema.org/draft/2020-12/schema'
3
+
4
+ $ref : ' https://spec.openapis.org/oas/3.1/schema/2021-03-02'
5
+ properties :
6
+ jsonSchemaDialect :
7
+ $ref : ' #/$defs/dialect'
8
+
9
+ $defs :
10
+ dialect :
11
+ const : ' https://spec.openapis.org/oas/3.1/dialect/base'
12
+ schema :
13
+ $dynamicAnchor : meta
14
+ $ref" : ' https://spec.openapis.org/oas/3.1/dialect/base'
15
+ properties :
16
+ $schema :
17
+ $ref : ' #/$defs/dialect'
Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ properties:
7
7
info :
8
8
$ref : ' #/$defs/info'
9
9
jsonSchemaDialect :
10
- type : string
10
+ $ref : ' #/$defs/uri'
11
+ default : ' https://spec.openapis.org/oas/3.1/dialect/base'
11
12
servers :
12
13
$ref : ' #/$defs/server'
13
14
paths :
@@ -681,7 +682,9 @@ $defs:
681
682
682
683
schema :
683
684
$dynamicAnchor : meta
684
- $ref : ' https://spec.openapis.org/oas/3.1/dialect/base'
685
+ type :
686
+ - object
687
+ - boolean
685
688
686
689
security-scheme :
687
690
type : object
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ before(async () => {
16
16
JsonSchema . add ( dialect ) ;
17
17
JsonSchema . add ( vocabulary ) ;
18
18
JsonSchema . add ( yaml . parse ( fs . readFileSync ( `${ __dirname } /schema.yaml` , "utf8" ) , { prettyErrors : true } ) ) ;
19
- metaSchema = await JsonSchema . get ( "https://spec.openapis.org/oas/3.1/schema/2021-03-02" ) ;
19
+ JsonSchema . add ( yaml . parse ( fs . readFileSync ( `${ __dirname } /schema-base.yaml` , "utf8" ) , { prettyErrors : true } ) ) ;
20
+ metaSchema = await JsonSchema . get ( "https://spec.openapis.org/oas/3.1/schema-base/2021-03-02" ) ;
20
21
} ) ;
21
22
22
23
describe ( "Pass" , ( ) => {
You can’t perform that action at this time.
0 commit comments