Skip to content

Commit

Permalink
chore: update next-spec branch with latest changes from master (#233
Browse files Browse the repository at this point in the history
)
  • Loading branch information
smoya authored Jun 23, 2022
1 parent 754fedf commit bd49a89
Show file tree
Hide file tree
Showing 435 changed files with 39,369 additions and 21,559 deletions.
1 change: 1 addition & 0 deletions .github/workflows/automerge-orphans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
identify-orphans:
if: startsWith(github.repository, 'asyncapi/')
name: Find orphans and notify
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/autoupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ on:

jobs:
autoupdate-for-bot:
if: startsWith(github.repository, 'asyncapi/')
name: Autoupdate autoapproved PR created in the upstream
runs-on: ubuntu-latest
steps:
- name: Autoupdating
uses: docker://chinthakagodawita/autoupdate-action:v1
env:
GITHUB_TOKEN: '${{ secrets.GH_TOKEN }}'
GITHUB_TOKEN: '${{ secrets.GH_TOKEN_BOT_EVE }}'
PR_FILTER: "labelled"
PR_LABELS: "autoupdate"
PR_READY_STATE: "ready_for_review"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/help-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- `/ready-to-merge` or `/rtm` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added
- `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added
- `/autoupdate` or `/au` - This comment will add `autoupdate` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict.
- `/autoupdate` or `/au` - This comment will add `autoupdate` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR.
create_help_comment_issue:
if: ${{ !github.event.issue.pull_request && contains(github.event.comment.body, '/help') && github.actor != 'asyncapi-bot' }}
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/link-check-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

jobs:
External-link-validation-weekly:
if: startsWith(github.repository, 'asyncapi/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This action is centrally managed in https://github.com/asyncapi/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo
#This action is centrally managed in https://github.com/asyncapi/.github/
#Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo

name: Lint PR title

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/stale-issues-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
stale:
if: startsWith(github.repository, 'asyncapi/')
name: Mark issue or PR as stale
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules
.nyc_output
.vscode
coverage
coverage
46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
79 changes: 79 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Contributing to AsyncAPI
We love your input! We want to make contributing to this project as easy and transparent as possible.

## Contribution recogniton

We use [All Contributors](https://allcontributors.org/docs/en/specification) specification to handle recognitions. For more details read [this](https://github.com/asyncapi/community/blob/master/recognize-contributors.md) document.

## Summary of the contribution flow

The following is a summary of the ideal contribution flow. Please, note that Pull Requests can also be rejected by the maintainers when appropriate.

```
┌───────────────────────┐
│ │
│ Open an issue │
│ (a bug report or a │
│ feature request) │
│ │
└───────────────────────┘
┌───────────────────────┐
│ │
│ Open a Pull Request │
│ (only after issue │
│ is approved) │
│ │
└───────────────────────┘
┌───────────────────────┐
│ │
│ Your changes will │
│ be merged and │
│ published on the next │
│ release │
│ │
└───────────────────────┘
```

## Code of Conduct
AsyncAPI has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](./CODE_OF_CONDUCT.md) so that you can understand what sort of behaviour is expected.

## Our Development Process
We use Github to host code, to track issues and feature requests, as well as accept pull requests.

## Issues
[Open an issue](https://github.com/asyncapi/asyncapi/issues/new) **only** if you want to report a bug or a feature. Don't open issues for questions or support, instead join our [Slack workspace](https://www.asyncapi.com/slack-invite) and ask there. Don't forget to follow our [Slack Etiquette](https://github.com/asyncapi/community/blob/master/slack-etiquette.md) while interacting with community members! It's more likely you'll get help, and much faster!

## Bug Reports and Feature Requests

Please use our issues templates that provide you with hints on what information we need from you to help you out.

## Pull Requests

**Please, make sure you open an issue before starting with a Pull Request, unless it's a typo or a really obvious error.** Pull requests are the best way to propose changes to the specification. Get familiar with our document that explains [Git workflow](https://github.com/asyncapi/community/blob/master/git-workflow.md) used in our repositories.

## Conventional commits

Our repositories follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) specification. Releasing to GitHub and NPM is done with the support of [semantic-release](https://semantic-release.gitbook.io/semantic-release/).

Pull requests should have a title that follows the specification, otherwise, merging is blocked. If you are not familiar with the specification simply ask maintainers to modify. You can also use this cheatsheet if you want:

- `fix: ` prefix in the title indicates that PR is a bug fix and PATCH release must be triggered.
- `feat: ` prefix in the title indicates that PR is a feature and MINOR release must be triggered.
- `docs: ` prefix in the title indicates that PR is only related to the documentation and there is no need to trigger release.
- `chore: ` prefix in the title indicates that PR is only related to cleanup in the project and there is no need to trigger release.
- `test: ` prefix in the title indicates that PR is only related to tests and there is no need to trigger release.
- `refactor: ` prefix in the title indicates that PR is only related to refactoring and there is no need to trigger release.

What about MAJOR release? just add `!` to the prefix, like `fix!: ` or `refactor!: `

Prefix that follows specification is not enough though. Remember that the title must be clear and descriptive with usage of [imperative mood](https://chris.beams.io/posts/git-commit/#imperative).

Happy contributing :heart:

## License
When you submit changes, your submissions are understood to be under the same [Apache 2.0 License](https://github.com/asyncapi/asyncapi/blob/master/LICENSE) that covers the project. Feel free to [contact the maintainers](https://www.asyncapi.com/slack-invite) if that's a concern.

## References
This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/master/CONTRIBUTING.md).
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
![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 package provides all the versions of the AsyncAPI schema.
This is a mono repository, which provides all the JSON Schema documents for validating AsyncAPI documents.

## Installation

Expand Down Expand Up @@ -45,7 +46,6 @@ const asyncapi = versions['1.1.0'];

// Do something with the schema.
```

### Go

Grab a specific AsyncAPI version:
Expand All @@ -62,4 +62,29 @@ 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).
- [./tools/bundler](./tools/bundler) - is the tool that bundles all the individual schemas together.
- [./schemas](./schemas) - contain all automatically bundled and complete schemas for each AsyncAPI version. These schemas should **NOT** be manually changed as they are automatically generated. Any changes should be done in [./definitions](./definitions).

## 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).

These definitions are automatically bundled together on new releases through the npm script `prepublishOnly`, which ensures the project is build. This is where the [bundler](./tools/bundler) is called.

For example, for [2.2.0](./definitions/2.2.0), the [bundler](./tools/bundler/index.js) starts with the [asyncapi.json](definitions/2.2.0/asyncapi.json) file and recursively goes through all references (`$ref`) to create the [appropriate bundled version](./schemas/2.2.0.json).

### Creating a new version
To create a new version, simply run the following command:
```
npm run startNewVersion --new-version=x.x.x
```
Where `x.x.x` is the new version you want to create.

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`.
36 changes: 36 additions & 0 deletions definitions/1.0.0/APIKeyHTTPSecurityScheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"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-": {}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://asyncapi.com/definitions/1.0.0/APIKeyHTTPSecurityScheme.json"
}
33 changes: 33 additions & 0 deletions definitions/1.0.0/BearerHTTPSecurityScheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"type": "object",
"required": [
"type",
"scheme"
],
"properties": {
"scheme": {
"type": "string",
"enum": [
"bearer"
]
},
"bearerFormat": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"http"
]
},
"description": {
"type": "string"
}
},
"patternProperties": {
"^x-": {}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://asyncapi.com/definitions/1.0.0/BearerHTTPSecurityScheme.json"
}
15 changes: 15 additions & 0 deletions definitions/1.0.0/HTTPSecurityScheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/1.0.0/NonBearerHTTPSecurityScheme.json"
},
{
"$ref": "http://asyncapi.com/definitions/1.0.0/BearerHTTPSecurityScheme.json"
},
{
"$ref": "http://asyncapi.com/definitions/1.0.0/APIKeyHTTPSecurityScheme.json"
}
],
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://asyncapi.com/definitions/1.0.0/HTTPSecurityScheme.json"
}
38 changes: 38 additions & 0 deletions definitions/1.0.0/NonBearerHTTPSecurityScheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"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-": {}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://asyncapi.com/definitions/1.0.0/NonBearerHTTPSecurityScheme.json"
}
14 changes: 14 additions & 0 deletions definitions/1.0.0/Reference.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"type": "object",
"required": [
"$ref"
],
"properties": {
"$ref": {
"type": "string",
"format": "uri"
}
},
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://asyncapi.com/definitions/1.0.0/Reference.json"
}
Loading

0 comments on commit bd49a89

Please sign in to comment.