Skip to content

Commit fc863ac

Browse files
committed
v3.1 Schema fix. $ref should be a uri-reference
1 parent 1e94f2c commit fc863ac

File tree

5 files changed

+24
-20
lines changed

5 files changed

+24
-20
lines changed

schemas/v3.1/schema-base.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"$id": "https://spec.openapis.org/oas/3.1/schema-base/2021-04-15",
2+
"$id": "https://spec.openapis.org/oas/3.1/schema-base/2021-05-20",
33
"$schema": "https://json-schema.org/draft/2020-12/schema",
4-
"$ref": "https://spec.openapis.org/oas/3.1/schema/2021-04-15",
4+
"$ref": "https://spec.openapis.org/oas/3.1/schema/2021-05-20",
55
"properties": {
66
"jsonSchemaDialect": {
77
"$ref": "#/$defs/dialect"

schemas/v3.1/schema-base.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
$id: 'https://spec.openapis.org/oas/3.1/schema-base/2021-04-15'
1+
$id: 'https://spec.openapis.org/oas/3.1/schema-base/2021-05-20'
22
$schema: 'https://json-schema.org/draft/2020-12/schema'
33

4-
$ref: 'https://spec.openapis.org/oas/3.1/schema/2021-04-15'
4+
$ref: 'https://spec.openapis.org/oas/3.1/schema/2021-05-20'
55
properties:
66
jsonSchemaDialect:
77
$ref: '#/$defs/dialect'

schemas/v3.1/schema.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "https://spec.openapis.org/oas/3.1/schema/2021-04-15",
2+
"$id": "https://spec.openapis.org/oas/3.1/schema/2021-05-20",
33
"$schema": "https://json-schema.org/draft/2020-12/schema",
44
"type": "object",
55
"properties": {
@@ -1331,7 +1331,7 @@
13311331
},
13321332
"uri": {
13331333
"type": "string",
1334-
"format": "uri"
1334+
"format": "uri-reference"
13351335
},
13361336
"map-of-strings": {
13371337
"type": "object",

schemas/v3.1/schema.yaml

+17-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$id: 'https://spec.openapis.org/oas/3.1/schema/2021-04-15'
1+
$id: 'https://spec.openapis.org/oas/3.1/schema/2021-05-20'
22
$schema: 'https://json-schema.org/draft/2020-12/schema'
33

44
type: object
@@ -9,7 +9,8 @@ properties:
99
info:
1010
$ref: '#/$defs/info'
1111
jsonSchemaDialect:
12-
$ref: '#/$defs/uri'
12+
type: string
13+
format: uri
1314
default: 'https://spec.openapis.org/oas/3.1/dialect/base'
1415
servers:
1516
type: array
@@ -90,7 +91,8 @@ $defs:
9091
identifier:
9192
type: string
9293
url:
93-
$ref: '#/$defs/uri'
94+
type: string
95+
format: uri
9496
required:
9597
- name
9698
oneOf:
@@ -105,7 +107,8 @@ $defs:
105107
type: object
106108
properties:
107109
url:
108-
$ref: '#/$defs/uri'
110+
type: string
111+
format: uri-reference
109112
description:
110113
type: string
111114
variables:
@@ -270,7 +273,8 @@ $defs:
270273
description:
271274
type: string
272275
url:
273-
$ref: '#/$defs/uri'
276+
type: string
277+
format: uri
274278
required:
275279
- url
276280
$ref: '#/$defs/specification-extensions'
@@ -574,7 +578,8 @@ $defs:
574578
type: string
575579
value: true
576580
externalValue:
577-
$ref: '#/$defs/uri'
581+
type: string
582+
format: uri
578583
$ref: '#/$defs/specification-extensions'
579584
unevaluatedProperties: false
580585

@@ -591,7 +596,8 @@ $defs:
591596
type: object
592597
properties:
593598
operationRef:
594-
$ref: '#/$defs/uri'
599+
type: string
600+
format: uri-reference
595601
operationId: true
596602
parameters:
597603
$ref: '#/$defs/map-of-strings'
@@ -681,7 +687,8 @@ $defs:
681687
type: object
682688
properties:
683689
$ref:
684-
$ref: '#/$defs/uri'
690+
type: string
691+
format: uri-reference
685692
summary:
686693
type: string
687694
description:
@@ -793,7 +800,8 @@ $defs:
793800
then:
794801
properties:
795802
openIdConnectUrl:
796-
$ref: '#/$defs/uri'
803+
type: string
804+
format: uri
797805
required:
798806
- openIdConnectUrl
799807

@@ -903,10 +911,6 @@ $defs:
903911
additionalProperties:
904912
$ref: '#/$defs/example-or-reference'
905913

906-
uri:
907-
type: string
908-
format: uri
909-
910914
map-of-strings:
911915
type: object
912916
additionalProperties:

tests/v3.1/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ before(async () => {
1414
JsonSchema.add(dialect);
1515
JsonSchema.add(vocabulary);
1616
JsonSchema.add(yaml.parse(fs.readFileSync(`${__dirname}/../../schemas/v3.1/schema.yaml`, "utf8"), { prettyErrors: true }));
17-
metaSchema = await JsonSchema.get("https://spec.openapis.org/oas/3.1/schema/2021-03-02");
17+
metaSchema = await JsonSchema.get("https://spec.openapis.org/oas/3.1/schema/2021-05-20");
1818
});
1919

2020
describe("Pass", () => {

0 commit comments

Comments
 (0)