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

chore: update next-spec branch with master changes #249

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
20f9a6a
ci(release): use new branch naming strategy (#215)
smoya May 10, 2022
ffb0ac9
ci: update generic workflows (#216)
asyncapi-bot May 10, 2022
8b5b53f
ci: update global contribution guide (#217)
asyncapi-bot May 12, 2022
e5edd3a
feat!: introduce split definitions (#184)
jonaslagoni May 16, 2022
0d71ca5
chore(release): v3.0.0 (#220)
asyncapi-bot May 16, 2022
f32fc99
chore(deps): bump node-fetch from 2.6.6 to 2.6.7 in /tools/bundler (#…
dependabot[bot] May 18, 2022
69cb903
chore: add separate script for creating new versions (#222)
jonaslagoni May 18, 2022
4d35a7d
chore: update code of conduct (#223)
asyncapi-bot May 24, 2022
38fbeaa
ci: update generic workflows (#226)
asyncapi-bot May 31, 2022
33a5ebc
chore(deps): bump semver-regex from 3.1.3 to 3.1.4 (#227)
dependabot[bot] Jun 3, 2022
77f09d1
chore(deps-dev): bump semantic-release from 17.4.3 to 19.0.3 (#228)
dependabot[bot] Jun 10, 2022
b6f8455
docs: explain how JSON Schema files are served (#229)
smoya Jun 15, 2022
7e1cb04
ci: update workflows for nodejs projects (#234)
asyncapi-bot Jun 22, 2022
68302ad
ci: update generic workflows (#235)
asyncapi-bot Jun 23, 2022
482cbfd
feat: add schema listing all Schema-Store JSON Schema docs (#237)
smoya Jul 13, 2022
b536f17
chore(release): v3.1.0 (#241)
asyncapi-bot Jul 13, 2022
24fb08c
docs: add 2 manual steps for creating new versions (#242)
smoya Jul 19, 2022
44e6de3
ci: update generic workflows (#246)
asyncapi-bot Jul 28, 2022
1b104ec
docs: update readme.md with overview and custom validation sections (…
Dindihub Jul 29, 2022
22c17e9
Merge branch 'master' into char0n/next-spec-update-from-master
char0n Sep 12, 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
18 changes: 18 additions & 0 deletions .github/workflows/if-nodejs-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ jobs:
- if: steps.packagejson.outputs.exists == 'true'
name: Run test
run: npm test
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
name: Report workflow run status to Slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,action,workflow
text: 'Release workflow failed in testing job'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}

release:
needs: [test-nodejs]
Expand Down Expand Up @@ -84,3 +93,12 @@ jobs:
GIT_COMMITTER_NAME: asyncapi-bot
GIT_COMMITTER_EMAIL: [email protected]
run: npm run release
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
name: Report workflow run status to Slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,action,workflow
text: 'Release workflow failed in release job'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
18 changes: 17 additions & 1 deletion .github/workflows/if-nodejs-version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ jobs:
- name: Check if Node.js project and has package.json
id: packagejson
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
- if: steps.packagejson.outputs.exists == 'true'
name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- if: steps.packagejson.outputs.exists == 'true'
name: Install dependencies
run: npm install
Expand All @@ -46,4 +53,13 @@ jobs:
author: asyncapi-bot <[email protected]>
title: 'chore(release): ${{github.event.release.tag_name}}'
body: 'Version bump in package.json for release [${{github.event.release.tag_name}}](${{github.event.release.html_url}})'
branch: version-bump/${{github.event.release.tag_name}}
branch: version-bump/${{github.event.release.tag_name}}
- if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
name: Report workflow run status to Slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,action,workflow
text: 'Unable to bump the version in package.json after the release'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
2 changes: 1 addition & 1 deletion .github/workflows/link-check-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
fields: repo,action,workflow
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
if: failure() # Only, on failure, send a message on the Slack Docs Channel (if there are broken links)
if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel
5 changes: 3 additions & 2 deletions .github/workflows/stale-issues-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Mark issue or PR as stale
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4.0.0
- uses: actions/stale@v5.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: |
Expand Down Expand Up @@ -41,4 +41,5 @@ jobs:
stale-issue-label: stale
stale-pr-label: stale
exempt-issue-labels: keep-open
exempt-pr-labels: keep-open
exempt-pr-labels: keep-open
close-issue-reason: not_planned
50 changes: 44 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
![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.
* 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).
* These JSON Schema files shouldn't be used as the only tool for validating AsyncAPI documents because some rules described in the AsyncAPI specification can't be described with JSON Schema.
* In addition, this repo provides JavaScript and Go modules that make it easier to access JSON Schema files through code.

## 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:
* Variables provided in the URL property have a corresponding variable object defined and its example is correct.
* operationIds are not duplicated in the document.
* messageIds are not duplicated in the document.
* Server security is declared properly and the name has a corresponding `securitySchemes` definition in `components` with the same name.
* Server `securitySchemes` is an empty array when the security type requires it.
* Parameters specified in the channel name have corresponding parameters object defined.
* Channel names do not contain URL parameters.
* All servers listed for a channel in the `servers` property are declared in the top-level `servers` object.
* Tags specified in any object have no duplicates. Check must be done for: the top-level object, operations (publish and subscribe), operation traits, channels, messages, and message traits.

At the moment, AsyncAPI JavaScript parser do not cover all validation cases yet
All test cases and parsers coverage can be found [here](https://asyncapi.github.io/tck/)

## Installation

Expand All @@ -16,7 +37,6 @@ npm install @asyncapi/specs
```bash
go get github.com/asyncapi/spec-json-schemas/v2
```

## Usage

### NodeJS
Expand Down Expand Up @@ -47,7 +67,6 @@ const asyncapi = versions['1.1.0'];
// Do something with the schema.
```
### Go

Grab a specific AsyncAPI version:

```go
Expand All @@ -61,9 +80,7 @@ func Do() {

// Do something with the schema
}

```

## Repository structure
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).
Expand All @@ -88,3 +105,24 @@ The manual process of creating a new version is to:
1. Duplicate the latest version (`y.y.y`) under definitions (so we have the correct base to make changes from).
2. Rename the folder to the new version (`x.x.x`).
3. Search and replace in the new duplicated folder for `y.y.y` and replace it with `x.x.x`.
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.:
```json
{
"allOf":[
{
"properties":{
"asyncapi":{
"const":"2.5.0"
}
}
},
{
"$ref":"http://asyncapi.com/schema-store/2.5.0.json"
}
]
}
```



Loading