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

feat!: split out definitions #128

Merged
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f72a1b9
Initial definitions
jonaslagoni Nov 11, 2021
f2428ce
Changed indentation to 2 char spaces
jonaslagoni Nov 11, 2021
bb8c0ce
Moved definition files
jonaslagoni Nov 11, 2021
8f684d1
Added $id to all files used for later bundling
jonaslagoni Nov 13, 2021
a78e012
Fixed regex problems and id's
jonaslagoni Nov 16, 2021
9dc083a
Moved definition files and replaced 2.2.0 schema with bundled example
jonaslagoni Nov 16, 2021
93f43c7
Merge branch 'master' into feature/improve_maintainability
jonaslagoni Nov 24, 2021
dcc9576
Added bundler to generate assets
jonaslagoni Nov 25, 2021
8ef1274
Removed unused file
jonaslagoni Nov 25, 2021
2309079
Added docs and comments
jonaslagoni Nov 25, 2021
462592e
Correct bundling behavior
jonaslagoni Nov 29, 2021
99f943f
Fixed bundler
jonaslagoni Nov 29, 2021
75b2fd9
Fixed id
jonaslagoni Nov 29, 2021
d558af6
Merge branch 'master' into feature/improve_maintainability
jonaslagoni Dec 2, 2021
bd614ac
Added local file ids and refs.
jonaslagoni Dec 6, 2021
788de6d
Reverted asyncapi file
jonaslagoni Dec 7, 2021
6a9995f
added try catch
jonaslagoni Dec 7, 2021
4bf78e4
Fixed URI resolution to not require breaking change.
jonaslagoni Dec 7, 2021
bc1d7ca
Added proper ids and references
jonaslagoni Dec 8, 2021
76e6bd4
Added sh script
jonaslagoni Dec 8, 2021
118d626
Merge branch 'master' into feature/improve_maintainability
jonaslagoni Dec 9, 2021
7910ebb
Updated readme and schemas
jonaslagoni Dec 9, 2021
c899ebc
Removed splitter
jonaslagoni Dec 9, 2021
15409c0
Ensured script checks if version exists
jonaslagoni Dec 9, 2021
b5c438c
Added better readme
jonaslagoni Dec 9, 2021
fe30188
Add migration and readme changes
jonaslagoni Dec 9, 2021
05f58ac
Split and bundled all versions.
jonaslagoni Dec 9, 2021
87c3c59
Merge branch 'master' into feature/improve_maintainability
jonaslagoni Dec 9, 2021
ec3c194
Updated migration guide
jonaslagoni Dec 9, 2021
2917fa3
Fixed tests
jonaslagoni Dec 9, 2021
126582d
Fixed tests
jonaslagoni Dec 9, 2021
54f7ee5
Added file ending to all definitions for consistency
jonaslagoni Dec 10, 2021
3f38322
Apply suggestions from code review
jonaslagoni Dec 10, 2021
dc88790
Apply suggestions from code review
jonaslagoni Dec 10, 2021
2658864
Added migration link in README.md
jonaslagoni Dec 10, 2021
40a636d
Merge branch 'master-github-upstream' into feature/improve_maintainab…
jonaslagoni Feb 2, 2022
e592d07
Applied 2.3.0 to definitions
jonaslagoni Feb 3, 2022
4ef1943
Auto generated the bundled schema
jonaslagoni Feb 3, 2022
f826036
Added build and prepubishOnly script
jonaslagoni Feb 4, 2022
71b9923
Removed bundled schemas
jonaslagoni Feb 4, 2022
5d8adb2
Adapted scripts to build bundled schemas accordingly.
jonaslagoni Feb 4, 2022
2255af7
Re-added schemas
jonaslagoni Feb 7, 2022
3c903ab
Reverted back to old pattern properties format
jonaslagoni Feb 7, 2022
dd45797
Fixed a copy/paste error
jonaslagoni Feb 9, 2022
17c99f9
Add prerelease branch
jonaslagoni Mar 4, 2022
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ const asyncapi = versions['1.1.0'];

// Do something with the schema.
```

# Modifying the schemas
Making changes to schemas version 2.2.0 or beyond should no longer be manually changed in the `./schemas` folder, but instead be done in their definition located in `definitions`.

## Creating a new version
To create a new version, simply copy paste the prior version (such as `2.2.0`) and adapt what ever changes is needed from there.
38 changes: 38 additions & 0 deletions definitions/2.2.0/APIKeyHTTPSecurityScheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"type": "object",
"required": [
"type",
"name",
"in"
],
"properties": {
"type": {
"type": "string",
"enum": [
"httpApiKey"
]
},
"name": {
"type": "string"
},
"in": {
"type": "string",
"enum": [
"header",
"query",
"cookie"
]
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-[\\w\\d.\\-_]+$": {
"$ref": "http://asyncapi.com/draft-07/schemas/specificationExtension"
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/draft-07/schemas/APIKeyHTTPSecurityScheme"
jonaslagoni marked this conversation as resolved.
Show resolved Hide resolved
}
35 changes: 35 additions & 0 deletions definitions/2.2.0/BearerHTTPSecurityScheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"type": "object",
"required": [
"type",
"scheme"
],
"properties": {
"scheme": {
"type": "string",
"enum": [
"bearer"
]
},
"bearerFormat": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"http"
]
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-[\\w\\d.\\-_]+$": {
"$ref": "http://asyncapi.com/draft-07/schemas/specificationExtension"
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/draft-07/schemas/BearerHTTPSecurityScheme"
}
15 changes: 15 additions & 0 deletions definitions/2.2.0/HTTPSecurityScheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"oneOf": [
{
"$ref": "http://asyncapi.com/draft-07/schemas/NonBearerHTTPSecurityScheme"
},
{
"$ref": "http://asyncapi.com/draft-07/schemas/BearerHTTPSecurityScheme"
},
{
"$ref": "http://asyncapi.com/draft-07/schemas/APIKeyHTTPSecurityScheme"
}
],
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/draft-07/schemas/HTTPSecurityScheme"
}
40 changes: 40 additions & 0 deletions definitions/2.2.0/NonBearerHTTPSecurityScheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"not": {
"type": "object",
"properties": {
"scheme": {
"type": "string",
"enum": [
"bearer"
]
}
}
},
"type": "object",
"required": [
"scheme",
"type"
],
"properties": {
"scheme": {
"type": "string"
},
"description": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"http"
]
}
},
"patternProperties": {
"^x-[\\w\\d.\\-_]+$": {
"$ref": "http://asyncapi.com/draft-07/schemas/specificationExtension"
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/draft-07/schemas/NonBearerHTTPSecurityScheme"
}
13 changes: 13 additions & 0 deletions definitions/2.2.0/Reference.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "object",
"required": [
"$ref"
],
"properties": {
"$ref": {
"$ref": "http://asyncapi.com/draft-07/schemas/ReferenceObject"
}
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/draft-07/schemas/Reference"
}
6 changes: 6 additions & 0 deletions definitions/2.2.0/ReferenceObject.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "string",
"format": "uri-reference",
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/draft-07/schemas/ReferenceObject"
}
25 changes: 25 additions & 0 deletions definitions/2.2.0/SaslGssapiSecurityScheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"gssapi"
]
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-[\\w\\d.\\-_]+$": {
"$ref": "http://asyncapi.com/draft-07/schemas/specificationExtension"
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/draft-07/schemas/SaslGssapiSecurityScheme"
}
25 changes: 25 additions & 0 deletions definitions/2.2.0/SaslPlainSecurityScheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"plain"
]
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-[\\w\\d.\\-_]+$": {
"$ref": "http://asyncapi.com/draft-07/schemas/specificationExtension"
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/draft-07/schemas/SaslPlainSecurityScheme"
}
26 changes: 26 additions & 0 deletions definitions/2.2.0/SaslScramSecurityScheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"scramSha256",
"scramSha512"
]
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-[\\w\\d.\\-_]+$": {
"$ref": "http://asyncapi.com/draft-07/schemas/specificationExtension"
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/draft-07/schemas/SaslScramSecurityScheme"
}
15 changes: 15 additions & 0 deletions definitions/2.2.0/SaslSecurityScheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"oneOf": [
{
"$ref": "http://asyncapi.com/draft-07/schemas/SaslPlainSecurityScheme"
},
{
"$ref": "http://asyncapi.com/draft-07/schemas/SaslScramSecurityScheme"
},
{
"$ref": "http://asyncapi.com/draft-07/schemas/SaslGssapiSecurityScheme"
}
],
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/draft-07/schemas/SaslSecurityScheme"
}
12 changes: 12 additions & 0 deletions definitions/2.2.0/SecurityRequirement.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/draft-07/schemas/SecurityRequirement"
}
33 changes: 33 additions & 0 deletions definitions/2.2.0/SecurityScheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"oneOf": [
{
"$ref": "http://asyncapi.com/draft-07/schemas/userPassword"
},
{
"$ref": "http://asyncapi.com/draft-07/schemas/apiKey"
},
{
"$ref": "http://asyncapi.com/draft-07/schemas/X509"
},
{
"$ref": "http://asyncapi.com/draft-07/schemas/symmetricEncryption"
},
{
"$ref": "http://asyncapi.com/draft-07/schemas/asymmetricEncryption"
},
{
"$ref": "http://asyncapi.com/draft-07/schemas/HTTPSecurityScheme"
},
{
"$ref": "http://asyncapi.com/draft-07/schemas/oauth2Flows"
},
{
"$ref": "http://asyncapi.com/draft-07/schemas/openIdConnect"
},
{
"$ref": "http://asyncapi.com/draft-07/schemas/SaslSecurityScheme"
}
],
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/draft-07/schemas/SecurityScheme"
}
25 changes: 25 additions & 0 deletions definitions/2.2.0/X509.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"X509"
]
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-[\\w\\d.\\-_]+$": {
"$ref": "http://asyncapi.com/draft-07/schemas/specificationExtension"
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/draft-07/schemas/X509"
}
33 changes: 33 additions & 0 deletions definitions/2.2.0/apiKey.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"type": "object",
"required": [
"type",
"in"
],
"properties": {
"type": {
"type": "string",
"enum": [
"apiKey"
]
},
"in": {
"type": "string",
"enum": [
"user",
"password"
]
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-[\\w\\d.\\-_]+$": {
"$ref": "http://asyncapi.com/draft-07/schemas/specificationExtension"
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/draft-07/schemas/apiKey"
}
Loading