Skip to content

Commit

Permalink
Add x-x extensions example in info component
Browse files Browse the repository at this point in the history
  • Loading branch information
Duc Tai Ly committed Dec 17, 2024
1 parent 8384cd8 commit 3563ab1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion library/src/containers/Info/Info.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -128,6 +129,12 @@ export const Info: React.FunctionComponent = () => {
<Tags tags={asyncapi.info().tags()} />
</div>
)}

{extensions.length > 0 && (
<div className="mt-4">
<Extensions name="Info Extensions" item={info} />
</div>
)}
</div>

<div className="panel-item--right" />
Expand Down
2 changes: 1 addition & 1 deletion playground/specs/streetlights.ts
Original file line number Diff line number Diff line change
@@ -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: |
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 3563ab1

Please sign in to comment.