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

docs: update readme.md with overview and custom validation sections #243

Merged
merged 23 commits into from
Jul 29, 2022
Merged
Changes from 5 commits
Commits
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
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,37 @@

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some not needed empty spaces



![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 for things like validation e.t.c
Dindihub marked this conversation as resolved.
Show resolved Hide resolved
Dindihub marked this conversation as resolved.
Show resolved Hide resolved
* These JSON Schema files shouldn't be used as the only tool for validating AsyncAPI documents because some rules described in the AsyncAPI specification are not described with JSON Schema.
Dindihub marked this conversation as resolved.
Show resolved Hide resolved
Dindihub marked this conversation as resolved.
Show resolved Hide resolved
* In addition, this repo provides JavaScript and Go modules that make it easier to access JSON Schema files through code.

derberg marked this conversation as resolved.
Show resolved Hide resolved
## Custom Validation Needs
* The JSON Schema does not cover all validation cases, and if you decide to validate AsyncAPI tools with only JSON Schema provided in this repo, you risk having the AsyncAPI documents not working in tandem with all AsyncAPI tools, and this will affect validation.
Dindihub marked this conversation as resolved.
Show resolved Hide resolved
* It's recommended to use [AsyncAPI JavaScript Parser](https://github.com/asyncapi/parser-js) that not only uses AsyncAPI JSON Schema file for validation but also implements additional custom validations.
Dindihub marked this conversation as resolved.
Show resolved Hide resolved

The following additional custom validations need to be provided:
* Validate if variables provided in the url property have corresponding variable object defined and if the example is correct
Dindihub marked this conversation as resolved.
Show resolved Hide resolved
* Validate if operationIds are duplicated in the document
Dindihub marked this conversation as resolved.
Show resolved Hide resolved
* Validate if messageIds are duplicated in the document
Dindihub marked this conversation as resolved.
Show resolved Hide resolved
* Validate if server security is declared properly and the name has a corresponding server securitySchemes definition in components with the same name
Dindihub marked this conversation as resolved.
Show resolved Hide resolved
* Validate if given server securitySchemes is a proper empty array when security type requires it
Dindihub marked this conversation as resolved.
Show resolved Hide resolved
* Validate if parameters specified in the channel name have corresponding parameters object defined and if name does not contain url parameters.
Dindihub marked this conversation as resolved.
Show resolved Hide resolved
* Validate if all servers listed for a channel in servers property are declared in the top-level servers object.
Dindihub marked this conversation as resolved.
Show resolved Hide resolved
* Validate if tags specified in the objects have no duplicates. Check is done for: root, operations, operation traits, channels, messages and message traits.
Dindihub marked this conversation as resolved.
Show resolved Hide resolved
* At the moment, AsyncAPI JavaScript parser do not cover all validation cases yet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this also should not be a bullet list element as it is not one of custom validations that user have to provide

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dindihub I think you missed this comment, line 24 should not be part of bullet list

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Sorry missed that one. Thnaks


All test cases and parsers coverage can be found [here](https://asyncapi.github.io/tck/)


## Installation

### NodeJS
Expand Down Expand Up @@ -106,3 +133,6 @@ The manual process of creating a new version is to:
]
}
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some not needed empty spaces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi. I have worked on the changes suggested. And thanks for the reference Doc. It helped. Please review.