Skip to content

Bump schema version numbers for 2022-02-17 release #2888

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

Merged
merged 1 commit into from
Mar 10, 2022
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
7 changes: 5 additions & 2 deletions schemas/v3.1/dialect/base.schema.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"title": "OpenAPI 3.1 Schema Object Dialect",
"description": "A JSON Schema dialect describing schemas found in OpenAPI documents",
"$id": "https://spec.openapis.org/oas/3.1/dialect/base",
"$schema": "https://json-schema.org/draft/2020-12/schema",

"title": "OpenAPI 3.1 Schema Object Dialect",
"description": "A JSON Schema dialect describing schemas found in OpenAPI documents",

"$vocabulary": {
"https://json-schema.org/draft/2020-12/vocab/core": true,
"https://json-schema.org/draft/2020-12/vocab/applicator": true,
Expand All @@ -13,6 +15,7 @@
"https://json-schema.org/draft/2020-12/vocab/content": true,
"https://spec.openapis.org/oas/3.1/vocab/base": false
},

"$dynamicAnchor": "meta",

"allOf": [
Expand Down
13 changes: 8 additions & 5 deletions schemas/v3.1/dialect/base.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
$id: https://spec.openapis.org/oas/3.1/dialect/base
$schema: https://json-schema.org/draft/2020-12/schema

title: OpenAPI 3.1 Schema Object Dialect
description: A JSON Schema dialect describing schemas found in OpenAPI documents

$dynamicAnchor: meta
$id: https://spec.openapis.org/oas/3.1/dialect/base
$schema: https://json-schema.org/draft/2020-12/schema

$vocabulary:
https://json-schema.org/draft/2020-12/vocab/applicator: true
https://json-schema.org/draft/2020-12/vocab/content: true
Expand All @@ -13,6 +15,7 @@ $vocabulary:
https://json-schema.org/draft/2020-12/vocab/unevaluated: true
https://json-schema.org/draft/2020-12/vocab/validation: true
https://spec.openapis.org/oas/3.1/vocab/base: false

allOf:
- $ref: https://json-schema.org/draft/2020-12/schema
- $ref: https://spec.openapis.org/oas/3.1/meta/base
- $ref: https://json-schema.org/draft/2020-12/schema
- $ref: https://spec.openapis.org/oas/3.1/meta/base
11 changes: 9 additions & 2 deletions schemas/v3.1/meta/base.schema.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"title": "OAS Base vocabulary",
"description": "A JSON Schema Vocabulary used in the OpenAPI Schema Dialect",
"$id": "https://spec.openapis.org/oas/3.1/meta/base",
"$schema": "https://json-schema.org/draft/2020-12/schema",

"title": "OAS Base vocabulary",
"description": "A JSON Schema Vocabulary used in the OpenAPI Schema Dialect",

"$vocabulary": {
"https://spec.openapis.org/oas/3.1/vocab/base": true
},

"$dynamicAnchor": "meta",

"type": ["object", "boolean"],
Expand All @@ -15,12 +18,14 @@
"externalDocs": { "$ref": "#/$defs/external-docs" },
"xml": { "$ref": "#/$defs/xml" }
},

"$defs": {
"extensible": {
"patternProperties": {
"^x-": true
}
},

"discriminator": {
"$ref": "#/$defs/extensible",
"type": "object",
Expand All @@ -38,6 +43,7 @@
"required": ["propertyName"],
"unevaluatedProperties": false
},

"external-docs": {
"$ref": "#/$defs/extensible",
"type": "object",
Expand All @@ -53,6 +59,7 @@
"required": ["url"],
"unevaluatedProperties": false
},

"xml": {
"$ref": "#/$defs/extensible",
"type": "object",
Expand Down
44 changes: 25 additions & 19 deletions schemas/v3.1/meta/base.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
---
$id: https://spec.openapis.org/oas/3.1/meta/base
$schema: https://json-schema.org/draft/2020-12/schema

title: OAS Base vocabulary
description: A JSON Schema Vocabulary used in the OpenAPI Schema Dialect

$dynamicAnchor: meta

$vocabulary:
https://spec.openapis.org/oas/3.1/vocab/base: true

type:
- object
- boolean
properties:
discriminator:
$ref: '#/$defs/discriminator'
example: true
externalDocs:
$ref: '#/$defs/external-docs'
xml:
$ref: '#/$defs/xml'

$defs:
discriminator:
$ref: '#/$defs/extensible'
Expand All @@ -12,9 +32,10 @@ $defs:
propertyName:
type: string
required:
- propertyName
- propertyName
type: object
unevaluatedProperties: false

extensible:
patternProperties:
^x-: true
Expand All @@ -27,9 +48,10 @@ $defs:
format: uri-reference
type: string
required:
- url
- url
type: object
unevaluatedProperties: false

xml:
$ref: '#/$defs/extensible'
properties:
Expand All @@ -46,19 +68,3 @@ $defs:
type: boolean
type: object
unevaluatedProperties: false
$dynamicAnchor: meta
$id: https://spec.openapis.org/oas/3.1/meta/base
$schema: https://json-schema.org/draft/2020-12/schema
$vocabulary:
https://spec.openapis.org/oas/3.1/vocab/base: true
properties:
discriminator:
$ref: '#/$defs/discriminator'
example: true
externalDocs:
$ref: '#/$defs/external-docs'
xml:
$ref: '#/$defs/xml'
type:
- object
- boolean
24 changes: 11 additions & 13 deletions schemas/v3.1/schema-base.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
{
"description": "The description of OpenAPI v3.1.x documents using the OpenAPI JSON Schema dialect, as defined by https://spec.openapis.org/oas/v3.1.0",
"$id": "https://spec.openapis.org/oas/3.1/schema-base/2021-09-28",
"$id": "https://spec.openapis.org/oas/3.1/schema-base/2022-02-27",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "https://spec.openapis.org/oas/3.1/schema/2021-09-28",

"description": "The description of OpenAPI v3.1.x documents using the OpenAPI JSON Schema dialect, as defined by https://spec.openapis.org/oas/v3.1.0",

"$ref": "https://spec.openapis.org/oas/3.1/schema/2022-02-27",
"properties": {
"jsonSchemaDialect": {
"$ref": "#/$defs/dialect"
}
"jsonSchemaDialect": { "$ref": "#/$defs/dialect" }
},

"$defs": {
"dialect": {
"const": "https://spec.openapis.org/oas/3.1/dialect/base"
},
"dialect": { "const": "https://spec.openapis.org/oas/3.1/dialect/base" },

"schema": {
"$dynamicAnchor": "meta",
"$ref": "https://spec.openapis.org/oas/3.1/dialect/base",
"properties": {
"$schema": {
"$ref": "#/$defs/dialect"
}
"$schema": { "$ref": "#/$defs/dialect" }
}
}
}
}
}
8 changes: 5 additions & 3 deletions schemas/v3.1/schema-base.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
description: The description of OpenAPI v3.1.x documents using the OpenAPI JSON Schema dialect, as defined by https://spec.openapis.org/oas/v3.1.0
$id: 'https://spec.openapis.org/oas/3.1/schema-base/2021-09-28'
$id: 'https://spec.openapis.org/oas/3.1/schema-base/2022-02-27'
$schema: 'https://json-schema.org/draft/2020-12/schema'

$ref: 'https://spec.openapis.org/oas/3.1/schema/2021-09-28'
description: The description of OpenAPI v3.1.x documents using the OpenAPI JSON Schema dialect, as defined by https://spec.openapis.org/oas/v3.1.0

$ref: 'https://spec.openapis.org/oas/3.1/schema/2022-02-27'
properties:
jsonSchemaDialect:
$ref: '#/$defs/dialect'

$defs:
dialect:
const: 'https://spec.openapis.org/oas/3.1/dialect/base'

schema:
$dynamicAnchor: meta
$ref: 'https://spec.openapis.org/oas/3.1/dialect/base'
Expand Down
4 changes: 2 additions & 2 deletions schemas/v3.1/schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"description": "The description of OpenAPI v3.1.x documents without schema validation, as defined by https://spec.openapis.org/oas/v3.1.0",
"$id": "https://spec.openapis.org/oas/3.1/schema/2021-09-28",
"$id": "https://spec.openapis.org/oas/3.1/schema/2022-02-27",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "The description of OpenAPI v3.1.x documents without schema validation, as defined by https://spec.openapis.org/oas/v3.1.0",
"type": "object",
"properties": {
"openapi": {
Expand Down
5 changes: 3 additions & 2 deletions schemas/v3.1/schema.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
description: The description of OpenAPI v3.1.x documents without schema validation, as defined by https://spec.openapis.org/oas/v3.1.0
$id: 'https://spec.openapis.org/oas/3.1/schema/2021-09-28'
$id: 'https://spec.openapis.org/oas/3.1/schema/2022-02-27'
$schema: 'https://json-schema.org/draft/2020-12/schema'

description: The description of OpenAPI v3.1.x documents without schema validation, as defined by https://spec.openapis.org/oas/v3.1.0

type: object
properties:
openapi:
Expand Down
2 changes: 1 addition & 1 deletion scripts/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const args = process.argv.reduce((acc, arg) => {
(async function () {
try {
const schemaType = args.schema || "schema";
const schemaVersion = args.version || "2021-03-02";
const schemaVersion = args.version || "2022-02-27";
const outputFormat = args.format || JsonSchema.BASIC;

// Config
Expand Down
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-09-28");
metaSchema = await JsonSchema.get("https://spec.openapis.org/oas/3.1/schema/2022-02-27");
});

describe("v3.1 Pass", () => {
Expand Down