Skip to content

Commit

Permalink
feat: support AsyncAPI 2.5.0 (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmatatjahu authored Sep 29, 2022
1 parent 7249389 commit c799fcb
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 43 deletions.
5 changes: 5 additions & 0 deletions components/Servers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { IndentationTypes, Text } from '@asyncapi/generator-react-sdk';

import { Bindings } from './Bindings';
import { Extensions } from './Extensions';
import { Tags } from './Tags';
import { Header, ListItem, Link, Table, NewLine } from './common';

import { ServerHelpers } from '../helpers/server';
Expand Down Expand Up @@ -36,6 +37,10 @@ function Server({ serverName, server, asyncapi }) {
<ServerVariables variables={server.variables()} />
<Security protocol={server.protocol()} security={server.security()} asyncapi={asyncapi} />

{server.hasTags() && (
<Tags name="Server tags" tags={server.tags()} />
)}

<Bindings
name="Server specific information"
item={server}
Expand Down
76 changes: 38 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
"dependencies": {
"@asyncapi/generator-filters": "^2.1.0",
"@asyncapi/generator-react-sdk": "^0.2.23",
"@asyncapi/parser": "^1.15.1",
"@asyncapi/parser": "^1.17.0",
"yaml": "^1.10.2"
},
"devDependencies": {
"@asyncapi/generator": "^1.9.6",
"@asyncapi/generator": "^1.9.12",
"@babel/preset-env": "^7.15.8",
"@babel/preset-react": "^7.14.5",
"@semantic-release/commit-analyzer": "^8.0.1",
Expand Down Expand Up @@ -78,7 +78,7 @@
},
"generator": {
"renderer": "react",
"generator": ">=1.1.0 <2.0.0",
"generator": ">=1.9.12 <2.0.0",
"parameters": {
"frontMatter": {
"description": "The name of a JSON or YAML formatted file containing values to provide the YAML frontmatter for static-site or documentation generators. The file may contain {{title}} and {{version}} replaceable tags.",
Expand Down
24 changes: 22 additions & 2 deletions test/components/Servers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,20 @@ describe('Servers component', () => {
url: 'development.gigantic-server.com',
description: 'Development server',
protocol: 'amqp',
protocolVersion: '0.9.1'
protocolVersion: '0.9.1',
tags: [
{ name: 'env:development' },
{ name: 'another-tag' },
],
},
staging: {
url: 'staging.gigantic-server.com',
description: 'Staging server',
protocol: 'amqp',
protocolVersion: '0.9.1'
protocolVersion: '0.9.1',
tags: [
{ name: 'env:staging' },
],
},
production: {
url: 'api.gigantic-server.com',
Expand All @@ -37,6 +44,13 @@ describe('Servers component', () => {
Development server
##### Server tags
| Name | Description | Documentation |
|---|---|---|
| env:development | - | - |
| another-tag | - | - |
### \`staging\` Server
Expand All @@ -45,6 +59,12 @@ Development server
Staging server
##### Server tags
| Name | Description | Documentation |
|---|---|---|
| env:staging | - | - |
### \`production\` Server
Expand Down

0 comments on commit c799fcb

Please sign in to comment.