diff --git a/components/OpenAPIComparison.tsx b/components/OpenAPIComparison.tsx index 4918be39aa1..cf938bd8509 100644 --- a/components/OpenAPIComparison.tsx +++ b/components/OpenAPIComparison.tsx @@ -1,27 +1,27 @@ import React, { useState } from 'react'; interface HoverState { - Info: boolean; - Servers: boolean; - Paths: boolean; - PathItem: boolean; - Summary: boolean; - Operation: boolean; - Message: boolean; - Tags: boolean; - External: boolean; - Components: boolean; + Info: boolean; + Servers: boolean; + Paths: boolean; + PathItem: boolean; + Summary: boolean; + Operation: boolean; + Message: boolean; + Tags: boolean; + External: boolean; + Components: boolean; } -interface Props { - className?: string; +interface OpenAPIComparisonProps { + className?: string; } /** * @description React component for comparing OpenAPI 3.0 and AsyncAPI 2.0. * @param {string} [props.className=''] - Additional CSS classes for styling. */ -export default function OpenAPIComparison({ className = '' }:Props) { +export default function OpenAPIComparison({ className = '' }: OpenAPIComparisonProps) { const [hoverState, setHoverState] = useState({ Info: false, Servers: false, @@ -36,42 +36,39 @@ export default function OpenAPIComparison({ className = '' }:Props) { }); return ( -
+

OpenAPI 3.0

-
-
setHoverState(prevState => ({ ...prevState, Info: true })) } onMouseLeave={ () => setHoverState({ ...hoverState, Info: false }) } data-testid='OpenAPI-sec-info'> - Info +
setHoverState(prevState => ({ ...prevState, Info: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Info: false })} data-testid='OpenAPI-sec-info'> + Info
-
setHoverState(prevState => ({ ...prevState, Servers: true })) } onMouseLeave={ () => setHoverState({ ...hoverState, Servers: false }) } data-testid='OpenAPI-sec-servers'> - Servers +
setHoverState(prevState => ({ ...prevState, Servers: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Servers: false })} data-testid='OpenAPI-sec-servers'> + Servers
- Security + Security
-
setHoverState(prevState => ({ ...prevState, Paths: true })) } onMouseLeave={ () => setHoverState({ ...hoverState, Paths: false }) } data-testid='OpenAPI-paths'> - Paths +
setHoverState(prevState => ({ ...prevState, Paths: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Paths: false })} data-testid='OpenAPI-paths'> + Paths
-
{ return setHoverState(prevState => ({ ...prevState, PathItem: true })); } } onMouseLeave={ () => { return setHoverState({ ...hoverState, PathItem: false }); } } data-testid='OpenAPI-path-item'> - Path Item - +
{ return setHoverState(prevState => ({ ...prevState, PathItem: true })); }} onMouseLeave={() => { return setHoverState({ ...hoverState, PathItem: false }); }} data-testid='OpenAPI-path-item'> + Path Item
-
setHoverState(prevState => ({ ...prevState, Summary: true })) } onMouseLeave={ () => { return setHoverState({ ...hoverState, Summary: false }); } } data-testid='OpenAPI-summary'> - Summary and description +
setHoverState(prevState => ({ ...prevState, Summary: true }))} onMouseLeave={() => { return setHoverState({ ...hoverState, Summary: false }); }} data-testid='OpenAPI-summary'> + Summary and description
-
setHoverState(prevState => ({ ...prevState, Operation: true })) } onMouseLeave={ () => setHoverState({ ...hoverState, Operation: false }) } data-testid='OpenAPI-operation'> - Operation (GET, PUT, POST, etc.) - +
setHoverState(prevState => ({ ...prevState, Operation: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Operation: false })} data-testid='OpenAPI-operation'> + Operation (GET, PUT, POST, etc.)
-
setHoverState(prevState => ({ ...prevState, Message: true })) } onMouseLeave={ () => setHoverState({ ...hoverState, Message: false }) } data-testid='OpenAPI-request'> - Request +
setHoverState(prevState => ({ ...prevState, Message: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Message: false })} data-testid='OpenAPI-request'> + Request
-
setHoverState(prevState => ({ ...prevState, Message: true })) } onMouseLeave={ () => setHoverState({ ...hoverState, Message: false }) } data-testid='OpenAPI-responses'> - Responses +
setHoverState(prevState => ({ ...prevState, Message: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Message: false })} data-testid='OpenAPI-responses'> + Responses
@@ -81,86 +78,79 @@ export default function OpenAPIComparison({ className = '' }:Props) {
-
setHoverState(prevState => ({ ...prevState, Tags: true })) } onMouseLeave={ () => setHoverState(prevState => ({ ...prevState, Tags: false })) } data-testid='OpenAPI-tags'> +
setHoverState(prevState => ({ ...prevState, Tags: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Tags: false }))} data-testid='OpenAPI-tags'>

Tags

-
setHoverState(prevState => ({ ...prevState, External: true })) } onMouseLeave={ () => setHoverState(prevState => ({ ...prevState, External: false })) } data-testid='OpenAPI-external'> +
setHoverState(prevState => ({ ...prevState, External: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, External: false }))} data-testid='OpenAPI-external'>

External Docs

-
setHoverState(prevState => ({ ...prevState, Components: true })) } onMouseLeave={ () => setHoverState(prevState => ({ ...prevState, Components: false })) } data-testid='OpenAPI-components'> - Components - +
setHoverState(prevState => ({ ...prevState, Components: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Components: false }))} data-testid='OpenAPI-components'> + Components
- Schemas + Schemas
- Responses + Responses
- Parameters + Parameters
- Examples + Examples
- Request Bodies + Request Bodies
- Headers + Headers
- Security Schemes + Security Schemes
- Links + Links
- Callbacks + Callbacks
-

AsyncAPI 2.0

-
-
setHoverState(prevState => ({ ...prevState, Info: true })) } onMouseLeave={ () => setHoverState(prevState => ({ ...prevState, Info: false })) }> - Info +
setHoverState(prevState => ({ ...prevState, Info: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Info: false }))}> + Info
-
setHoverState(prevState => ({ ...prevState, Servers: true })) } onMouseLeave={ () => setHoverState(prevState => ({ ...prevState, Servers: false })) }> - Servers (hosts + security) +
setHoverState(prevState => ({ ...prevState, Servers: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Servers: false }))}> + Servers (hosts + security)
-
setHoverState(prevState => ({ ...prevState, Paths: true })) } onMouseLeave={ () => setHoverState(prevState => ({ ...prevState, Paths: false })) }> - Channel - +
setHoverState(prevState => ({ ...prevState, Paths: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Paths: false }))}> + Channel
-
setHoverState(prevState => ({ ...prevState, PathItem: true })) } onMouseLeave={ () => setHoverState(prevState => ({ ...prevState, PathItem: false })) }> - Channel Item - +
setHoverState(prevState => ({ ...prevState, PathItem: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, PathItem: false }))}> + Channel Item
-
setHoverState(prevState => ({ ...prevState, Operation: true })) } onMouseLeave={ () => setHoverState(prevState => ({ ...prevState, Operation: false })) }> - Operation (Publish and Subscribe) - +
setHoverState(prevState => ({ ...prevState, Operation: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Operation: false }))}> + Operation (Publish and Subscribe)
-
setHoverState(prevState => ({ ...prevState, Summary: true })) } onMouseLeave={ () => setHoverState(prevState => ({ ...prevState, Summary: false })) } > - Summary, description, tags, etc. +
setHoverState(prevState => ({ ...prevState, Summary: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Summary: false }))} > + Summary, description, tags, etc.
-
setHoverState(prevState => ({ ...prevState, Message: true })) } onMouseLeave={ () => setHoverState(prevState => ({ ...prevState, Message: false })) }> - Message - +
setHoverState(prevState => ({ ...prevState, Message: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Message: false }))}> + Message
- Headers + Headers
- Payload + Payload
@@ -173,53 +163,52 @@ export default function OpenAPIComparison({ className = '' }:Props) {
- Id (application identifier) + Id (application identifier)
-
setHoverState(prevState => ({ ...prevState, Tags: true })) } onMouseLeave={ () => setHoverState(prevState => ({ ...prevState, Tags: false })) }> +
setHoverState(prevState => ({ ...prevState, Tags: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Tags: false }))}>

Tags

-
setHoverState(prevState => ({ ...prevState, External: true })) } onMouseLeave={ () => setHoverState(prevState => ({ ...prevState, External: false })) }> +
setHoverState(prevState => ({ ...prevState, External: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, External: false }))}>

External Docs

-
setHoverState(prevState => ({ ...prevState, Components: true })) } onMouseLeave={ () => setHoverState(prevState => ({ ...prevState, Components: false })) }> - Components - +
setHoverState(prevState => ({ ...prevState, Components: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Components: false }))}> + Components
- Schemas + Schemas
- Messages + Messages
- Security Schemes + Security Schemes
- Parameters + Parameters
- Correlation Ids + Correlation Ids
- Operation Traits + Operation Traits
- Message Traits + Message Traits
- Server Bindings + Server Bindings
- Channel Bindings + Channel Bindings
- Operation Bindings + Operation Bindings
- Message Bindings + Message Bindings
diff --git a/components/OpenAPIComparisonV3.tsx b/components/OpenAPIComparisonV3.tsx index 64e63ec3296..f1cfddbd66d 100644 --- a/components/OpenAPIComparisonV3.tsx +++ b/components/OpenAPIComparisonV3.tsx @@ -1,29 +1,29 @@ import React, { useState } from 'react'; interface HoverState { - Info: boolean; - Servers: boolean; - Paths: boolean; - PathItem: boolean; - Summary: boolean; - Operations: boolean; - OperationItem: boolean; - OperationType: boolean; - Message: boolean; - Tags: boolean; - External: boolean; - Components: boolean; + Info: boolean; + Servers: boolean; + Paths: boolean; + PathItem: boolean; + Summary: boolean; + Operations: boolean; + OperationItem: boolean; + OperationType: boolean; + Message: boolean; + Tags: boolean; + External: boolean; + Components: boolean; } -interface Props { - className?: string; +interface OpenAPIComparisonV3Props { + className?: string; } /** * @description OpenAPIComparisonV3 component displays a comparison between OpenAPI 3.0 and AsyncAPI 3.0 specifications. * @param {string} [props.className=''] - Additional CSS classes for styling */ -export default function OpenAPIComparisonV3({ className = '' }:Props) { +export default function OpenAPIComparisonV3({ className = '' }: OpenAPIComparisonV3Props) { const [hoverState, setHoverState] = useState({ Info: false, Servers: false, @@ -43,43 +43,39 @@ export default function OpenAPIComparisonV3({ className = '' }:Props) {

OpenAPI 3.0

-
-
setHoverState(prevState => ({ ...prevState, Info: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Info: false })}> - Info +
setHoverState(prevState => ({ ...prevState, Info: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Info: false })}> + Info
-
setHoverState(prevState => ({ ...prevState, Servers: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Servers: false })}> - Servers +
setHoverState(prevState => ({ ...prevState, Servers: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Servers: false })}> + Servers
- Security + Security
-
setHoverState(prevState => ({ ...prevState, Paths: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Paths: false })}> - Paths +
setHoverState(prevState => ({ ...prevState, Paths: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Paths: false })}> + Paths
-
{ return setHoverState(prevState => ({ ...prevState, PathItem: true })); }} onMouseLeave={() => { return setHoverState({ ...hoverState, PathItem: false }); }}> - Path Item - +
{ return setHoverState(prevState => ({ ...prevState, PathItem: true })); }} onMouseLeave={() => { return setHoverState({ ...hoverState, PathItem: false }); }}> + Path Item
-
setHoverState(prevState => ({ ...prevState, Summary: true }))} onMouseLeave={() => { return setHoverState({ ...hoverState, Summary: false }); }}> - Summary and description +
setHoverState(prevState => ({ ...prevState, Summary: true }))} onMouseLeave={() => { return setHoverState({ ...hoverState, Summary: false }); }}> + Summary and description
-
setHoverState(prevState => ({ ...prevState, OperationItem: true }))} onMouseLeave={() => setHoverState({ ...hoverState, OperationItem: false })}> - Operation -
setHoverState(prevState => ({ ...prevState, OperationType: true }))} onMouseLeave={() => setHoverState({ ...hoverState, OperationType: false })}> - GET, PUT, POST, etc. +
setHoverState(prevState => ({ ...prevState, OperationItem: true }))} onMouseLeave={() => setHoverState({ ...hoverState, OperationItem: false })}> + Operation +
setHoverState(prevState => ({ ...prevState, OperationType: true }))} onMouseLeave={() => setHoverState({ ...hoverState, OperationType: false })}> + GET, PUT, POST, etc.
- -
setHoverState(prevState => ({ ...prevState, Message: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Message: false })}> - Request +
setHoverState(prevState => ({ ...prevState, Message: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Message: false })}> + Request
-
setHoverState(prevState => ({ ...prevState, Message: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Message: false })}> - Responses +
setHoverState(prevState => ({ ...prevState, Message: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Message: false })}> + Responses
-
@@ -87,102 +83,92 @@ export default function OpenAPIComparisonV3({ className = '' }:Props) {
-
setHoverState(prevState => ({ ...prevState, Tags: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Tags: false }))}> +
setHoverState(prevState => ({ ...prevState, Tags: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Tags: false }))}>

Tags

-
setHoverState(prevState => ({ ...prevState, External: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, External: false }))}> +
setHoverState(prevState => ({ ...prevState, External: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, External: false }))}>

External Docs

-
setHoverState(prevState => ({ ...prevState, Components: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Components: false }))}> - Components - +
setHoverState(prevState => ({ ...prevState, Components: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Components: false }))}> + Components
- Definitions + Definitions
- Responses + Responses
- Parameters + Parameters
- Response Headers + Response Headers
- Security Definitions + Security Definitions
- Callbacks + Callbacks
- Links + Links
-

AsyncAPI 3.0

-
-
setHoverState(prevState => ({ ...prevState, Info: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Info: false }))}> - Info +
setHoverState(prevState => ({ ...prevState, Info: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Info: false }))}> + Info
-
setHoverState(prevState => ({ ...prevState, Servers: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Servers: false }))}> - Servers (hosts + security) +
setHoverState(prevState => ({ ...prevState, Servers: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Servers: false }))}> + Servers (hosts + security)
-
setHoverState(prevState => ({ ...prevState, Paths: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Paths: false }))}> - Channels - +
setHoverState(prevState => ({ ...prevState, Paths: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Paths: false }))}> + Channels
-
setHoverState(prevState => ({ ...prevState, PathItem: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, PathItem: false }))}> - Channel - +
setHoverState(prevState => ({ ...prevState, PathItem: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, PathItem: false }))}> + Channel
-
setHoverState(prevState => ({ ...prevState, Summary: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Summary: false }))} > - Summary, description +
setHoverState(prevState => ({ ...prevState, Summary: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Summary: false }))} > + Summary, description
-
-
setHoverState(prevState => ({ ...prevState, Message: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Message: false }))}> - Messages - +
setHoverState(prevState => ({ ...prevState, Message: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Message: false }))}> + Messages
- Headers + Headers
- Payload + Payload
-
-
setHoverState(prevState => ({ ...prevState, Operations: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Operations: false }))}> - Operations +
setHoverState(prevState => ({ ...prevState, Operations: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Operations: false }))}> + Operations
-
setHoverState(prevState => ({ ...prevState, OperationItem: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, OperationItem: false }))}> - Operation - +
setHoverState(prevState => ({ ...prevState, OperationItem: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, OperationItem: false }))}> + Operation
-
setHoverState(prevState => ({ ...prevState, OperationType: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, OperationType: false }))}> - action (send or receive) +
setHoverState(prevState => ({ ...prevState, OperationType: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, OperationType: false }))}> + action (send or receive)
-
{ return setHoverState(prevState => ({ ...prevState, PathItem: true })); }} onMouseLeave={() => { return setHoverState({ ...hoverState, PathItem: false }); }}> - - Channel reference +
{ return setHoverState(prevState => ({ ...prevState, PathItem: true })); }} onMouseLeave={() => { return setHoverState({ ...hoverState, PathItem: false }); }}> + Channel reference
-
setHoverState(prevState => ({ ...prevState, Message: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Message: false })}> - Messages reference +
setHoverState(prevState => ({ ...prevState, Message: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Message: false })}> + Messages reference
@@ -190,58 +176,57 @@ export default function OpenAPIComparisonV3({ className = '' }:Props) {
- Id (application identifier) + Id (application identifier)
-
setHoverState(prevState => ({ ...prevState, Tags: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Tags: false }))}> +
setHoverState(prevState => ({ ...prevState, Tags: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Tags: false }))}>

Tags

-
setHoverState(prevState => ({ ...prevState, External: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, External: false }))}> +
setHoverState(prevState => ({ ...prevState, External: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, External: false }))}>

External Docs

-
setHoverState(prevState => ({ ...prevState, Components: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Components: false }))}> - Components - +
setHoverState(prevState => ({ ...prevState, Components: true }))} onMouseLeave={() => setHoverState(prevState => ({ ...prevState, Components: false }))}> + Components
- Schemas + Schemas
- Messages + Messages
- Security Schemes + Security Schemes
- Parameters + Parameters
- Correlation Ids + Correlation Ids
- Operation Traits + Operation Traits
- Message Traits + Message Traits
- Server Bindings + Server Bindings
- Channel Bindings + Channel Bindings
- Operation Bindings + Operation Bindings
- Message Bindings + Message Bindings
-
+
); }