File tree Expand file tree Collapse file tree 5 files changed +54
-3
lines changed Expand file tree Collapse file tree 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
1313example, the value of ` $id: https://spec.openapis.org/oas/3.1/schema/2021-03-02 `
1414means this iteration was created on March 2nd, 2021.
1515
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
1622To submit improvements to the schema, modify the schema.yaml file only.
1723
1824The 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:
77 info :
88 $ref : ' #/$defs/info'
99 jsonSchemaDialect :
10- type : string
10+ $ref : ' #/$defs/uri'
11+ default : ' https://spec.openapis.org/oas/3.1/dialect/base'
1112 servers :
1213 $ref : ' #/$defs/server'
1314 paths :
@@ -681,7 +682,9 @@ $defs:
681682
682683 schema :
683684 $dynamicAnchor : meta
684- $ref : ' https://spec.openapis.org/oas/3.1/dialect/base'
685+ type :
686+ - object
687+ - boolean
685688
686689 security-scheme :
687690 type : object
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ before(async () => {
1616 JsonSchema . add ( dialect ) ;
1717 JsonSchema . add ( vocabulary ) ;
1818 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" ) ;
2021} ) ;
2122
2223describe ( "Pass" , ( ) => {
You can’t perform that action at this time.
0 commit comments