Skip to content

Commit 24e105a

Browse files
jonaslagonismoya
andauthored
fix: prepare next-major-spec for release (#421)
Co-authored-by: Sergio Moya <1083296+smoya@users.noreply.github.com>
1 parent 31f4f9c commit 24e105a

File tree

4 files changed

+66
-1
lines changed

4 files changed

+66
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ func Do() {
108108

109109
If you are currently using version 2, check out [migration guideline to version 3](./migrations/migrate-to-version-3.md).
110110
If you are currently using version 3, check out [migration guideline to version 4](./migrations/migrate-to-version-4.md).
111+
If you are currently using version 4, check out [migration guideline to version 5](./migrations/migrate-to-version-5.md).
112+
If you are currently using version 5, check out [migration guideline to version 6](./migrations/migrate-to-version-6.md).
111113

112114
## Repository structure
113115

@@ -183,7 +185,7 @@ Whenever a Breaking Change is introduced, the following steps should be taken in
183185

184186
## SchemaStore compatibility testing
185187

186-
AsyncAPI JSON Schema is referenced in [SchemaStore](https://www.schemastore.org/json/). In many IDEs, like VSCode, some extensions integrate with SchemaStore, like [YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml). This way we enable autocompletion, validation and tooltips that helps writing AsyncAPI documents.
188+
AsyncAPI JSON Schema is referenced in [SchemaStore](https://www.schemastore.org/json/). In many IDEs, like VSCode, some extensions integrate with SchemaStore, like [YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml). This way we enable autocompletion, validation and tooltips that help write AsyncAPI documents.
187189

188190
Whenever you make changes in AsyncAPI JSON Schema, you should always manually verify that the schema is still supported by [YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) and that it will be able to fetch and dereference it.
189191

migrations/migrate-to-version-5.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Migrating to version 5
2+
3+
In version 5, we now export two different types of schemas, one using `$id` feature in JSON Schema, and one without.
4+
5+
In v4, the library would export the schemas as:
6+
```js
7+
module.exports = {
8+
'2.0.0': require('./schemas/2.0.0.json'),
9+
...
10+
};
11+
```
12+
13+
In v5, you need to access the schemas through `.schemas` instead.
14+
15+
```js
16+
module.exports = {
17+
'schemas': {
18+
'2.0.0': require('./schemas/2.0.0.json'),
19+
...
20+
},
21+
'schemasWithoutId': {
22+
'2.0.0': require('./schemas/2.0.0-without-$id.json'),
23+
...
24+
}
25+
};
26+
```
27+
28+
And if you want the schemas without `$id`, use `schemasWithoutId`.

migrations/migrate-to-version-6.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Migrating to version 6
2+
3+
In version 6 and onwards, all pre-release AsyncAPI specification versions will be released as a regular feature request, before the AsyncAPI specification itself is released.
4+
5+
The pre-release version will be released as if it was not a pre-release, for example for AsyncAPI 3.0, it will be released as normal:
6+
```js
7+
module.exports = {
8+
'schemas': {
9+
...
10+
'3.0.0': require('./schemas/3.0.0.json'),
11+
},
12+
'schemasWithoutId': {
13+
...
14+
'3.0.0': require('./schemas/3.0.0-without-$id.json'),
15+
}
16+
};
17+
```
18+
19+
However, while it's still a pre-release, the underlying schemas CAN contain breaking changes from version to version, up until the AsyncAPI specification is released. This means that one AsyncAPI document using v3 in the pre-release stage might be valid in `6.0.0`, but invalid in the `6.1.0`. This ONLY applies to pre-release schemas, and NOT regular ones that are set in stone.
20+
21+
If you want to make sure you don't use a schema not released yet, you have to whitelist which versions you allow in your tool.

schemas/all.schema-store.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,20 @@
172172
"$ref": "http://asyncapi.com/schema-store/2.6.0-without-$id.json"
173173
}
174174
]
175+
},
176+
{
177+
"allOf": [
178+
{
179+
"properties": {
180+
"asyncapi": {
181+
"const": "3.0.0"
182+
}
183+
}
184+
},
185+
{
186+
"$ref": "http://asyncapi.com/schema-store/3.0.0-without-$id.json"
187+
}
188+
]
175189
}
176190
]
177191
}

0 commit comments

Comments
 (0)