From 52e7a03c94827e215b2dab839eb85a0c42cd942e Mon Sep 17 00:00:00 2001 From: Matatjahu Date: Tue, 27 Sep 2022 13:34:36 +0200 Subject: [PATCH 1/2] feat: support 2.5.0 --- library/src/containers/Servers/Server.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/library/src/containers/Servers/Server.tsx b/library/src/containers/Servers/Server.tsx index dae9fbeb9..747a01d11 100644 --- a/library/src/containers/Servers/Server.tsx +++ b/library/src/containers/Servers/Server.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Server as ServerType } from '@asyncapi/parser'; import { Security } from './Security'; -import { Markdown, Schema, Bindings } from '../../components'; +import { Markdown, Schema, Bindings, Tags, Extensions } from '../../components'; import { useConfig } from '../../contexts'; import { CommonHelpers, SchemaHelpers } from '../../helpers'; @@ -85,6 +85,14 @@ export const Server: React.FunctionComponent = ({ /> )} + + + + {server.hasTags() && ( +
+ +
+ )} From 9140171333a1950ff3c82e829762be6ea3ec1a2a Mon Sep 17 00:00:00 2001 From: Matatjahu Date: Thu, 29 Sep 2022 10:34:15 +0200 Subject: [PATCH 2/2] feat: support AsyncAPI 2.5.0 --- library/package-lock.json | 34 +++++++++++++---------- library/package.json | 2 +- library/src/containers/Servers/Server.tsx | 2 +- playground/src/specs/streetlights.ts | 4 ++- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/library/package-lock.json b/library/package-lock.json index f30efd00a..9e5a133cd 100644 --- a/library/package-lock.json +++ b/library/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@asyncapi/avro-schema-parser": "^0.3.0", "@asyncapi/openapi-schema-parser": "^2.0.0", - "@asyncapi/parser": "^1.15.0", + "@asyncapi/parser": "^1.17.0", "highlight.js": "^10.7.2", "isomorphic-dompurify": "^0.13.0", "marked": "^4.0.14", @@ -49,6 +49,10 @@ "webpack": "^4.41.2", "webpack-bundle-analyzer": "^4.4.0", "webpack-cli": "^3.3.12" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" } }, "node_modules/@apidevtools/json-schema-ref-parser": { @@ -87,12 +91,12 @@ } }, "node_modules/@asyncapi/parser": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-1.15.0.tgz", - "integrity": "sha512-ff4ljaNry0BFvlM1SOSff3jvZyKkiBVJgIOqHcUZtKBAmXxpvsX0nz9pi8fHbg9NrmNyASPCVTCpiDb7Zasreg==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-1.17.0.tgz", + "integrity": "sha512-xNXtGZ/hTf8a1C4X65ESKkBJgSx0o9RDyX3LYdQfdQWsDjjmltK4saa9Peu+0Nr2bHU+xaziRo4tOv8QmJ5qfA==", "dependencies": { "@apidevtools/json-schema-ref-parser": "^9.0.6", - "@asyncapi/specs": "^2.14.0", + "@asyncapi/specs": "^3.2.0", "@fmvilas/pseudo-yaml-ast": "^0.3.1", "ajv": "^6.10.1", "js-yaml": "^3.13.1", @@ -103,9 +107,9 @@ } }, "node_modules/@asyncapi/specs": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-2.14.0.tgz", - "integrity": "sha512-hHsYF6XsYNIKb1P2rXaooF4H+uKKQ4b/Ljxrk3rZ3riEDiSxMshMEfb1fUlw9Yj4V4OmJhjXwkNvw8W59AXv1A==" + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-3.2.0.tgz", + "integrity": "sha512-4tzJfhAk5IetJyUDzxl6oQ5oNDnX8+Q7kM62eksONdhJlfU9KYzx/mUeQrbHTFKBROi6yKXcYD842+ahICk8EA==" }, "node_modules/@babel/code-frame": { "version": "7.16.7", @@ -16369,12 +16373,12 @@ } }, "@asyncapi/parser": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-1.15.0.tgz", - "integrity": "sha512-ff4ljaNry0BFvlM1SOSff3jvZyKkiBVJgIOqHcUZtKBAmXxpvsX0nz9pi8fHbg9NrmNyASPCVTCpiDb7Zasreg==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-1.17.0.tgz", + "integrity": "sha512-xNXtGZ/hTf8a1C4X65ESKkBJgSx0o9RDyX3LYdQfdQWsDjjmltK4saa9Peu+0Nr2bHU+xaziRo4tOv8QmJ5qfA==", "requires": { "@apidevtools/json-schema-ref-parser": "^9.0.6", - "@asyncapi/specs": "^2.14.0", + "@asyncapi/specs": "^3.2.0", "@fmvilas/pseudo-yaml-ast": "^0.3.1", "ajv": "^6.10.1", "js-yaml": "^3.13.1", @@ -16385,9 +16389,9 @@ } }, "@asyncapi/specs": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-2.14.0.tgz", - "integrity": "sha512-hHsYF6XsYNIKb1P2rXaooF4H+uKKQ4b/Ljxrk3rZ3riEDiSxMshMEfb1fUlw9Yj4V4OmJhjXwkNvw8W59AXv1A==" + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-3.2.0.tgz", + "integrity": "sha512-4tzJfhAk5IetJyUDzxl6oQ5oNDnX8+Q7kM62eksONdhJlfU9KYzx/mUeQrbHTFKBROi6yKXcYD842+ahICk8EA==" }, "@babel/code-frame": { "version": "7.16.7", diff --git a/library/package.json b/library/package.json index fc71b933e..a5ef8b6c8 100644 --- a/library/package.json +++ b/library/package.json @@ -70,7 +70,7 @@ "dependencies": { "@asyncapi/avro-schema-parser": "^0.3.0", "@asyncapi/openapi-schema-parser": "^2.0.0", - "@asyncapi/parser": "^1.15.0", + "@asyncapi/parser": "^1.17.0", "highlight.js": "^10.7.2", "isomorphic-dompurify": "^0.13.0", "marked": "^4.0.14", diff --git a/library/src/containers/Servers/Server.tsx b/library/src/containers/Servers/Server.tsx index 747a01d11..38fb6a164 100644 --- a/library/src/containers/Servers/Server.tsx +++ b/library/src/containers/Servers/Server.tsx @@ -88,7 +88,7 @@ export const Server: React.FunctionComponent = ({ - {server.hasTags() && ( + {typeof server.hasTags === 'function' && server.hasTags() && (
diff --git a/playground/src/specs/streetlights.ts b/playground/src/specs/streetlights.ts index ec4bc2d88..a39986be0 100644 --- a/playground/src/specs/streetlights.ts +++ b/playground/src/specs/streetlights.ts @@ -1,4 +1,4 @@ -export const streetlights = `asyncapi: '2.4.0' +export const streetlights = `asyncapi: '2.5.0' id: 'urn:com:smartylighting:streetlights:server' info: title: Streetlights API @@ -76,6 +76,8 @@ servers: enum: - '1883' - '8883' + tags: + - name: 'env:production' security: - apiKey: [] - supportedOauthFlows: