From 3563ab12f8e89f079cdbd7c96b9a11681c7dc05a Mon Sep 17 00:00:00 2001 From: Duc Tai Ly Date: Tue, 17 Dec 2024 14:02:37 +0100 Subject: [PATCH] Add x-x extensions example in info component --- library/src/containers/Info/Info.tsx | 9 ++++++++- playground/specs/streetlights.ts | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/library/src/containers/Info/Info.tsx b/library/src/containers/Info/Info.tsx index a32eeb269..dbc5dfbcb 100644 --- a/library/src/containers/Info/Info.tsx +++ b/library/src/containers/Info/Info.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { Href, Markdown, Tags } from '../../components'; +import { Extensions, Href, Markdown, Tags } from '../../components'; import { useSpec } from '../../contexts'; import { TERMS_OF_SERVICE_TEXT, @@ -23,6 +23,7 @@ export const Info: React.FunctionComponent = () => { const termsOfService = info.termsOfService(); const defaultContentType = asyncapi.defaultContentType(); const contact = info.contact(); + const extensions = info.extensions(); const showInfoList = license ?? termsOfService ?? defaultContentType ?? contact ?? externalDocs; @@ -128,6 +129,12 @@ export const Info: React.FunctionComponent = () => { )} + + {extensions.length > 0 && ( +
+ +
+ )}
diff --git a/playground/specs/streetlights.ts b/playground/specs/streetlights.ts index 40c6c52e9..fa178ed0d 100644 --- a/playground/specs/streetlights.ts +++ b/playground/specs/streetlights.ts @@ -1,6 +1,7 @@ export const streetlights = `asyncapi: '2.6.0' id: 'urn:com:smartylighting:streetlights:server' info: + x-x: AsyncAPISpec title: Streetlights API version: '1.0.0' description: | @@ -136,7 +137,6 @@ servers: channels: smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured: - x-x: AsyncAPISpec x-security: $ref: '#/components/securitySchemes/supportedOauthFlows/flows/clientCredentials' description: The topic on which measured values may be produced and consumed.