@asyncapi/specs
Advanced tools
Comparing version 3.2.1 to 4.0.0
module.exports = { | ||
'1.0.0': require('./schemas/1.0.0.json'), | ||
'1.1.0': require('./schemas/1.1.0.json'), | ||
'1.2.0': require('./schemas/1.2.0.json'), | ||
'2.0.0-rc1': require('./schemas/2.0.0-rc1.json'), | ||
'2.0.0-rc2': require('./schemas/2.0.0-rc2.json'), | ||
'2.0.0': require('./schemas/2.0.0.json'), | ||
@@ -8,0 +3,0 @@ '2.1.0': require('./schemas/2.1.0.json'), |
{ | ||
"name": "@asyncapi/specs", | ||
"version": "3.2.1", | ||
"version": "4.0.0", | ||
"description": "AsyncAPI schema versions", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"scripts": { | ||
@@ -85,3 +86,6 @@ "test": "npm run build && nyc mocha", | ||
] | ||
}, | ||
"dependencies": { | ||
"@types/json-schema": "^7.0.11" | ||
} | ||
} |
![npm](https://img.shields.io/npm/v/@asyncapi/specs?style=for-the-badge) ![npm](https://img.shields.io/npm/dt/@asyncapi/specs?style=for-the-badge) | ||
> If you are currently using version 2, check out [migration guideline to version 3](./migrations/Migrate%20to%20version%203.md). You might be able to update it without any change. | ||
# AsyncAPI | ||
This is a mono repository, which provides all the JSON Schema documents for validating AsyncAPI documents. | ||
## Overview | ||
* This repository contains [JSON Schema](https://json-schema.org) files for all the versions of AsyncAPI specification. | ||
@@ -12,6 +15,8 @@ * These JSON Schema files do not reflect 1:1 the specification and shouldn't be treated as specification itself but rather as a tool (e.g., for validation). | ||
## Custom Validation Needs | ||
If you decide to validate AsyncAPI documents only with the JSON Schema files provided in this repo, your AsyncAPI documents will not be properly validated. | ||
It's recommended to use [AsyncAPI JavaScript Parser](https://github.com/asyncapi/parser-js) that uses the AsyncAPI JSON Schema files for validation but also implements additional custom validations. | ||
The following additional custom validations need to be provided: | ||
The following additional custom validations need to be provided: | ||
* Variables provided in the URL property have a corresponding variable object defined and its example is correct. | ||
@@ -33,10 +38,15 @@ * operationIds are not duplicated in the document. | ||
### NodeJS | ||
```bash | ||
npm install @asyncapi/specs | ||
// OR by Yarn | ||
yarn add @asyncapi/specs | ||
``` | ||
### Go | ||
```bash | ||
go get github.com/asyncapi/spec-json-schemas/v2 | ||
``` | ||
## Usage | ||
@@ -54,3 +64,3 @@ | ||
Get a list of versions: | ||
Get a list of supported versions: | ||
@@ -72,3 +82,8 @@ ```js | ||
``` | ||
> **Note** | ||
> The main export of the package provides only supported versions of AsyncAPI (newer or equal to `2.0.0`). To use older ones (e.g. `1.2.0`) please import an absolute path like `@asyncapi/specs/schemas/1.2.0`; | ||
### Go | ||
Grab a specific AsyncAPI version: | ||
@@ -88,4 +103,12 @@ | ||
``` | ||
## Migration guidelines | ||
If you are currently using version 2, check out [migration guideline to version 3](./migrations/migrate-to-version-3.md). | ||
If you are currently using version 3, check out [migration guideline to version 4](./migrations/migrate-to-version-4.md). | ||
## Repository structure | ||
This is the current project structure explained. | ||
This is the current project structure explained: | ||
- [./definitions](./definitions) - contain all the individual schemas that will automatically be bundled together to provide the schemas in [./schemas](./schemas). | ||
@@ -96,2 +119,3 @@ - [./tools/bundler](./tools/bundler) - is the tool that bundles all the individual schemas together. | ||
## Schema Bundling | ||
Changes should not be done manually to the schemas in [./schemas](./schemas), but instead be done in their individual definitions located in [./definitions](./definitions). | ||
@@ -104,6 +128,9 @@ | ||
### Creating a new version | ||
To create a new version, simply run the following command: | ||
``` | ||
```bash | ||
npm run startNewVersion --new-version=x.x.x | ||
``` | ||
Where `x.x.x` is the new version you want to create. | ||
@@ -116,3 +143,5 @@ | ||
4. Edit the [index.js](./index.js) file adding a new line with the new version. I.e. `'2.5.0': require('./schemas/2.5.0.json'),`. | ||
5. Edit the [schemas/all.schema-store.json](./schemas/all.schema-store.json) file adding a new entry under the `oneOf` keyword with the new version. I.e.: | ||
5. Edit the [index.d.ts](./index.d.ts) file adding a new line with the types for the new version. I.e. `'2.5.0': JSONSchema7,`. | ||
6. Edit the [schemas/all.schema-store.json](./schemas/all.schema-store.json) file adding a new entry under the `oneOf` keyword with the new version. I.e.: | ||
```json | ||
@@ -133,5 +162,2 @@ { | ||
} | ||
``` | ||
``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14035944
870
112815
154
1
+ Added@types/json-schema@^7.0.11
+ Added@types/json-schema@7.0.15(transitive)