Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.1 Schema bugfix: Update URI fields to use uri-reference or uri where appropriate #2586

Merged
merged 3 commits into from
May 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions schemas/v3.1/schema-base.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$id": "https://spec.openapis.org/oas/3.1/schema-base/2021-04-15",
"$id": "https://spec.openapis.org/oas/3.1/schema-base/2021-05-20",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "https://spec.openapis.org/oas/3.1/schema/2021-04-15",
"$ref": "https://spec.openapis.org/oas/3.1/schema/2021-05-20",
"properties": {
"jsonSchemaDialect": {
"$ref": "#/$defs/dialect"
Expand Down
4 changes: 2 additions & 2 deletions schemas/v3.1/schema-base.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$id: 'https://spec.openapis.org/oas/3.1/schema-base/2021-04-15'
$id: 'https://spec.openapis.org/oas/3.1/schema-base/2021-05-20'
$schema: 'https://json-schema.org/draft/2020-12/schema'

$ref: 'https://spec.openapis.org/oas/3.1/schema/2021-04-15'
$ref: 'https://spec.openapis.org/oas/3.1/schema/2021-05-20'
properties:
jsonSchemaDialect:
$ref: '#/$defs/dialect'
Expand Down
30 changes: 17 additions & 13 deletions schemas/v3.1/schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "https://spec.openapis.org/oas/3.1/schema/2021-04-15",
"$id": "https://spec.openapis.org/oas/3.1/schema/2021-05-20",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
Expand All @@ -11,7 +11,8 @@
"$ref": "#/$defs/info"
},
"jsonSchemaDialect": {
"$ref": "#/$defs/uri",
"type": "string",
"format": "uri",
"default": "https://spec.openapis.org/oas/3.1/dialect/base"
},
"servers": {
Expand Down Expand Up @@ -130,7 +131,8 @@
"type": "string"
},
"url": {
"$ref": "#/$defs/uri"
"type": "string",
"format": "uri"
}
},
"required": [
Expand All @@ -155,7 +157,8 @@
"type": "object",
"properties": {
"url": {
"$ref": "#/$defs/uri"
"type": "string",
"format": "uri-reference"
},
"description": {
"type": "string"
Expand Down Expand Up @@ -390,7 +393,8 @@
"type": "string"
},
"url": {
"$ref": "#/$defs/uri"
"type": "string",
"format": "uri"
}
},
"required": [
Expand Down Expand Up @@ -849,7 +853,8 @@
},
"value": true,
"externalValue": {
"$ref": "#/$defs/uri"
"type": "string",
"format": "uri"
}
},
"$ref": "#/$defs/specification-extensions",
Expand All @@ -872,7 +877,8 @@
"type": "object",
"properties": {
"operationRef": {
"$ref": "#/$defs/uri"
"type": "string",
"format": "uri-reference"
},
"operationId": true,
"parameters": {
Expand Down Expand Up @@ -1003,7 +1009,8 @@
"type": "object",
"properties": {
"$ref": {
"$ref": "#/$defs/uri"
"type": "string",
"format": "uri-reference"
},
"summary": {
"type": "string"
Expand Down Expand Up @@ -1176,7 +1183,8 @@
"then": {
"properties": {
"openIdConnectUrl": {
"$ref": "#/$defs/uri"
"type": "string",
"format": "uri"
}
},
"required": [
Expand Down Expand Up @@ -1329,10 +1337,6 @@
}
}
},
"uri": {
"type": "string",
"format": "uri"
},
"map-of-strings": {
"type": "object",
"additionalProperties": {
Expand Down
30 changes: 17 additions & 13 deletions schemas/v3.1/schema.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$id: 'https://spec.openapis.org/oas/3.1/schema/2021-04-15'
$id: 'https://spec.openapis.org/oas/3.1/schema/2021-05-20'
$schema: 'https://json-schema.org/draft/2020-12/schema'

type: object
Expand All @@ -9,7 +9,8 @@ properties:
info:
$ref: '#/$defs/info'
jsonSchemaDialect:
$ref: '#/$defs/uri'
type: string
format: uri
default: 'https://spec.openapis.org/oas/3.1/dialect/base'
servers:
type: array
Expand Down Expand Up @@ -90,7 +91,8 @@ $defs:
identifier:
type: string
url:
$ref: '#/$defs/uri'
type: string
format: uri
required:
- name
oneOf:
Expand All @@ -105,7 +107,8 @@ $defs:
type: object
properties:
url:
$ref: '#/$defs/uri'
type: string
format: uri-reference
description:
type: string
variables:
Expand Down Expand Up @@ -270,7 +273,8 @@ $defs:
description:
type: string
url:
$ref: '#/$defs/uri'
type: string
format: uri
required:
- url
$ref: '#/$defs/specification-extensions'
Expand Down Expand Up @@ -574,7 +578,8 @@ $defs:
type: string
value: true
externalValue:
$ref: '#/$defs/uri'
type: string
format: uri
$ref: '#/$defs/specification-extensions'
unevaluatedProperties: false

Expand All @@ -591,7 +596,8 @@ $defs:
type: object
properties:
operationRef:
$ref: '#/$defs/uri'
type: string
format: uri-reference
operationId: true
parameters:
$ref: '#/$defs/map-of-strings'
Expand Down Expand Up @@ -681,7 +687,8 @@ $defs:
type: object
properties:
$ref:
$ref: '#/$defs/uri'
type: string
format: uri-reference
summary:
type: string
description:
Expand Down Expand Up @@ -793,7 +800,8 @@ $defs:
then:
properties:
openIdConnectUrl:
$ref: '#/$defs/uri'
type: string
format: uri
required:
- openIdConnectUrl

Expand Down Expand Up @@ -903,10 +911,6 @@ $defs:
additionalProperties:
$ref: '#/$defs/example-or-reference'

uri:
type: string
format: uri

map-of-strings:
type: object
additionalProperties:
Expand Down
12 changes: 0 additions & 12 deletions tests/v3.1/fail/sever_enum_unknown.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion tests/v3.1/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ before(async () => {
JsonSchema.add(dialect);
JsonSchema.add(vocabulary);
JsonSchema.add(yaml.parse(fs.readFileSync(`${__dirname}/../../schemas/v3.1/schema.yaml`, "utf8"), { prettyErrors: true }));
metaSchema = await JsonSchema.get("https://spec.openapis.org/oas/3.1/schema/2021-03-02");
metaSchema = await JsonSchema.get("https://spec.openapis.org/oas/3.1/schema/2021-05-20");
});

describe("Pass", () => {
Expand Down