Skip to content

Commit ae0464c

Browse files
committed
Merge remote-tracking branch 'upstream/v3.1-dev' into 3.1-schema-test-coverage
2 parents 6f26e0b + fd1cd3b commit ae0464c

34 files changed

+4539
-215
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve the specification
4+
title: 'vX.Y: ...'
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the error in the specification**
11+
A clear and concise description of
12+
- what the error is,
13+
- which specification versions are affected,
14+
- what you would expect the specification to say instead, and
15+
- a link to the corresponding specification section in the "oldest" affected version.
16+
17+
**Additional context**
18+
Add any other context about the problem here.

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ node_modules/
88
deploy/
99
deploy-preview/
1010
coverage/
11-
history
11+
_site/
1212
Gemfile.lock

CONTRIBUTING.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ Draft pull requests can still be reviewed while in draft state.
165165

166166
### Preview specification HTML locally
167167

168+
> [!NOTE]
169+
> `npm run build-src` calls bash scripts. Use [Git Bash](https://gitforwindows.org/) on Windows, or use the Windows Subsystem for Linux (WSL).
170+
168171
The markdown source files are converted to HTML before publishing.
169172
To do this locally, please
170173

@@ -199,7 +202,7 @@ The steps for creating a `vX.Y.Z-rel` branch are:
199202

200203
1. Update `EDITORS.md` on `main`
201204
2. Merge `main` into `dev` and `dev` into `vX.Y-dev` via PRs
202-
- Sync PRs are automatically created by workflows `sync-main-to-dev` and `sync-dev-to-vX.Y-dev`
205+
- sync PRs are automatically created by workflows `sync-main-to-dev` and `sync-dev-to-vX.Y-dev`
203206
3. Prepare spec files in `vX.Y-dev`
204207
- `npm run format-markdown`
205208
- `npm run build-src`
@@ -211,6 +214,7 @@ The steps for creating a `vX.Y.Z-rel` branch are:
211214
- copy `EDITORS.md` to `versions/X.Y.Z-editors.md`
212215
- delete `src/schemas`
213216
- delete `tests/schema`
217+
- bash script `scripts/adjust-release-branch.sh` performs these steps
214218
5. Merge `vX.Y.Z-rel` into `main` via PR
215219
- this PR should only add files `versions/X.Y.Z.md` and `versions/X.Y.Z-editors.md`
216220

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ This GitHub project is the starting point for OpenAPI. Here you will find the in
1919

2020
This repository contains [the Markdown sources](versions) for [all published OpenAPI Specification versions](https://spec.openapis.org/). For release notes and release candidate versions, refer to the [releases page](releases).
2121

22-
Each folder in this repository, such as [schemas](schemas) and [tests](tests), should contain folders pertaining to the current and previous versions of the specification.
23-
2422
## See It in Action
2523

2624
If you just want to see it work, check out the [list of current examples](https://learn.openapis.org/examples/).

_archive_/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Archive
2+
3+
This folder contains files that are no longer actively maintained.

_archive_/schemas/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Archive of outdated JSON Schema Files
2+
3+
> [!TIP]
4+
> JSON Schema files for validating OpenAPI descriptions using current OpenAPI versions are available on https://spec.openapis.org/#openapi-specification-schemas.
5+
>
6+
> These schema files are maintained in the `src/schemas` folder of the corresponding `vX.Y-dev` branch in this repository.
7+
8+
> [!CAUTION]
9+
> Schema files in this folder are not maintained any more and are not intended for productive use.

_archive_/schemas/v1.2/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Swagger Specification JSON Schemas
2+
3+
The work on the JSON Schema for the Swagger Specification was donated to the community by [Francis Galiegue](https://github.com/fge)!
4+
5+
Keep in mind that due to some JSON Schema limitations, not all constraints can be described. The missing constraints will be listed here in the future.
+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/apiDeclaration.json#",
3+
"$schema": "http://json-schema.org/draft-04/schema#",
4+
"type": "object",
5+
"required": [ "swaggerVersion", "basePath", "apis" ],
6+
"properties": {
7+
"swaggerVersion": { "enum": [ "1.2" ] },
8+
"apiVersion": { "type": "string" },
9+
"basePath": {
10+
"type": "string",
11+
"format": "uri",
12+
"pattern": "^https?://"
13+
},
14+
"resourcePath": {
15+
"type": "string",
16+
"format": "uri",
17+
"pattern": "^/"
18+
},
19+
"apis": {
20+
"type": "array",
21+
"items": { "$ref": "#/definitions/apiObject" }
22+
},
23+
"models": {
24+
"type": "object",
25+
"additionalProperties": {
26+
"$ref": "modelsObject.json#"
27+
}
28+
},
29+
"produces": { "$ref": "#/definitions/mimeTypeArray" },
30+
"consumes": { "$ref": "#/definitions/mimeTypeArray" },
31+
"authorizations": { "$ref": "authorizationObject.json#" }
32+
},
33+
"additionalProperties": false,
34+
"definitions": {
35+
"apiObject": {
36+
"type": "object",
37+
"required": [ "path", "operations" ],
38+
"properties": {
39+
"path": {
40+
"type": "string",
41+
"format": "uri-template",
42+
"pattern": "^/"
43+
},
44+
"description": { "type": "string" },
45+
"operations": {
46+
"type": "array",
47+
"items": { "$ref": "operationObject.json#" }
48+
}
49+
},
50+
"additionalProperties": false
51+
},
52+
"mimeTypeArray": {
53+
"type": "array",
54+
"items": {
55+
"type": "string",
56+
"format": "mime-type"
57+
},
58+
"uniqueItems": true
59+
}
60+
}
61+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/authorizationObject.json#",
3+
"$schema": "http://json-schema.org/draft-04/schema#",
4+
"type": "object",
5+
"additionalProperties": {
6+
"oneOf": [
7+
{
8+
"$ref": "#/definitions/basicAuth"
9+
},
10+
{
11+
"$ref": "#/definitions/apiKey"
12+
},
13+
{
14+
"$ref": "#/definitions/oauth2"
15+
}
16+
]
17+
},
18+
"definitions": {
19+
"basicAuth": {
20+
"required": [ "type" ],
21+
"properties": {
22+
"type": { "enum": [ "basicAuth" ] }
23+
},
24+
"additionalProperties": false
25+
},
26+
"apiKey": {
27+
"required": [ "type", "passAs", "keyname" ],
28+
"properties": {
29+
"type": { "enum": [ "apiKey" ] },
30+
"passAs": { "enum": [ "header", "query" ] },
31+
"keyname": { "type": "string" }
32+
},
33+
"additionalProperties": false
34+
},
35+
"oauth2": {
36+
"type": "object",
37+
"required": [ "type", "grantTypes" ],
38+
"properties": {
39+
"type": { "enum": [ "oauth2" ] },
40+
"scopes": {
41+
"type": "array",
42+
"items": { "$ref": "#/definitions/oauth2Scope" }
43+
},
44+
"grantTypes": { "$ref": "oauth2GrantType.json#" }
45+
},
46+
"additionalProperties": false
47+
},
48+
"oauth2Scope": {
49+
"type": "object",
50+
"required": [ "scope" ],
51+
"properties": {
52+
"scope": { "type": "string" },
53+
"description": { "type": "string" }
54+
},
55+
"additionalProperties": false
56+
}
57+
}
58+
}
59+

_archive_/schemas/v1.2/dataType.json

+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
{
2+
"id": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/dataType.json#",
3+
"$schema": "http://json-schema.org/draft-04/schema#",
4+
"description": "Data type as described by the specification (version 1.2)",
5+
"type": "object",
6+
"oneOf": [
7+
{ "$ref": "#/definitions/refType" },
8+
{ "$ref": "#/definitions/voidType" },
9+
{ "$ref": "#/definitions/primitiveType" },
10+
{ "$ref": "#/definitions/modelType" },
11+
{ "$ref": "#/definitions/arrayType" }
12+
],
13+
"definitions": {
14+
"refType": {
15+
"required": [ "$ref" ],
16+
"properties": {
17+
"$ref": { "type": "string" }
18+
},
19+
"additionalProperties": false
20+
},
21+
"voidType": {
22+
"enum": [ { "type": "void" } ]
23+
},
24+
"modelType": {
25+
"required": [ "type" ],
26+
"properties": {
27+
"type": {
28+
"type": "string",
29+
"not": {
30+
"enum": [ "boolean", "integer", "number", "string", "array" ]
31+
}
32+
}
33+
},
34+
"additionalProperties": false
35+
},
36+
"primitiveType": {
37+
"required": [ "type" ],
38+
"properties": {
39+
"type": {
40+
"enum": [ "boolean", "integer", "number", "string" ]
41+
},
42+
"format": { "type": "string" },
43+
"defaultValue": {
44+
"not": { "type": [ "array", "object", "null" ] }
45+
},
46+
"enum": {
47+
"type": "array",
48+
"items": { "type": "string" },
49+
"minItems": 1,
50+
"uniqueItems": true
51+
},
52+
"minimum": { "type": "string" },
53+
"maximum": { "type": "string" }
54+
},
55+
"additionalProperties": false,
56+
"dependencies": {
57+
"format": {
58+
"oneOf": [
59+
{
60+
"properties": {
61+
"type": { "enum": [ "integer" ] },
62+
"format": { "enum": [ "int32", "int64" ] }
63+
}
64+
},
65+
{
66+
"properties": {
67+
"type": { "enum": [ "number" ] },
68+
"format": { "enum": [ "float", "double" ] }
69+
}
70+
},
71+
{
72+
"properties": {
73+
"type": { "enum": [ "string" ] },
74+
"format": {
75+
"enum": [ "byte", "date", "date-time" ]
76+
}
77+
}
78+
}
79+
]
80+
},
81+
"enum": {
82+
"properties": {
83+
"type": { "enum": [ "string" ] }
84+
}
85+
},
86+
"minimum": {
87+
"properties": {
88+
"type": { "enum": [ "integer", "number" ] }
89+
}
90+
},
91+
"maximum": {
92+
"properties": {
93+
"type": { "enum": [ "integer", "number" ] }
94+
}
95+
}
96+
}
97+
},
98+
"arrayType": {
99+
"required": [ "type", "items" ],
100+
"properties": {
101+
"type": { "enum": [ "array" ] },
102+
"items": {
103+
"type": "array",
104+
"items": { "$ref": "#/definitions/itemsObject" }
105+
},
106+
"uniqueItems": { "type": "boolean" }
107+
},
108+
"additionalProperties": false
109+
},
110+
"itemsObject": {
111+
"oneOf": [
112+
{
113+
"$ref": "#/definitions/refType"
114+
},
115+
{
116+
"allOf": [
117+
{
118+
"$ref": "#/definitions/primitiveType"
119+
},
120+
{
121+
"properties": {
122+
"type": {},
123+
"format": {}
124+
},
125+
"additionalProperties": false
126+
}
127+
]
128+
}
129+
]
130+
}
131+
}
132+
}

0 commit comments

Comments
 (0)