Skip to content

Commit

Permalink
update as per review
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmohona committed Oct 13, 2023
1 parent abf9c53 commit 3b3e546
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions pages/docs/concepts/asyncapi-document/extending-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ weight: 240

Extending the AsyncAPI specification is a technique that allows developers to include domain-specific or use-case-specific information not supported by the base specification. This extension capability provides customization, enabling APIs to accommodate unique details that would not otherwise fit within the confines of the standard AsyncAPI specification.

The benefits of extending the AsyncAPI specification include enhanced specificity — delivering a clear encoding of necessary API details to applications, and consistency — allowing reusable components across the API. However, extensions should be used sparingly. Since they go beyond the Specification, they may not be universally understood.

## Specification extensions

The AsyncAPI Specification allows the addition of custom properties through patterned fields prefixed with `x-`. This helps you create unique things without causing problems with future updates.
Expand Down Expand Up @@ -43,8 +41,7 @@ channels:
messages:
userSignedUp:
description: An event describing that a user just signed up.
$ref: '#/components/messages/UserSignedUp'
x-custom-property: Custom Value
x-custom-property: Custom Value
```
In the above document, under the `user/signedup` channel, a custom property `x-custom-property` is added. The value assigned to this property is `Custom Value`.
Expand All @@ -55,7 +52,7 @@ All available tooling might not support AsyncAPI extensions. The tooling can be

## Extending unsupported features

When facing a case where the AsyncAPI specification does not support the required feature, that functionality can be extended using these extensions. If the extended part also benefits other developers, you could contribute to the AsyncAPI specification. This contribution can be made by [creating an issue](https://github.com/asyncapi/website/issues/new?assignees=alequetzalli+-&labels=%F0%9F%93%91+docs&projects=&template=docs.yml&title=%5B%F0%9F%93%91+Docs%5D%3A+) on the AsyncAPI GitHub repository.
When facing a case where the AsyncAPI specification does not support the required feature, that functionality can be extended using these extensions. If the extended part also benefits other developers, you could contribute to the AsyncAPI specification. This contribution can be made by [creating an issue](https://github.com/asyncapi/spec) on the AsyncAPI GitHub repository. Please get familiar with [contribution guide](https://github.com/asyncapi/spec/blob/master/CONTRIBUTING.md) before making an contribution.

Here is a diagram showing details about extending extending unsupported features:

Expand All @@ -65,32 +62,12 @@ Here is a diagram showing details about extending extending unsupported features
B[Extend using Extensions]
C[Beneficial to Others?]
D[Contribute to Specification]
E[Create an issue on GitHub]
style A fill:#47BCEE,stroke:#47BCEE;
A --> B
B --> C
C -->|Yes| D
C -->|No| E
```

This diagram represents the process of extending AsyncAPI specifications when unsupported features are encountered, with an option to contribute to the specification if it benefits others.

## Using the AsyncAPI studio

When extending the AsyncAPI specification, you can use the[AsyncAPI Studio](https://studio.asyncapi.com/), a recommended dedicated editor for AsyncAPI specifications. The AsyncAPI Studio allows you to create, edit, and visualize specification files. It also performs validation checks to ensure the specifications are correct and renders them in a user-friendly manner.

Here is a diagram showing when to use AsyncAPI studio:

```mermaid
graph TD
A[Extend AsyncAPI Specification] --> B[Use AsyncAPI Studio]
B --> C[Create, Edit, Visualize]
B --> D[Perform Validation Checks]
B --> E[Renders User-Friendly Output]
style B fill:#47BCEE,stroke:#47BCEE;
```

The diagram shows the process of extending the AsyncAPI specification using the recommended AsyncAPI Studio editor.

0 comments on commit 3b3e546

Please sign in to comment.