Skip to content

Commit

Permalink
Support schemas with array of types (#1017)
Browse files Browse the repository at this point in the history
* Add support for array of types

* Add example for multiple types
  • Loading branch information
MarcL01 authored Nov 8, 2024
1 parent 875f84c commit 6e55849
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions demo/examples/petstore-1.0.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,14 @@ paths:
properties:
name:
description: Updated name of the pet
type: string
type:
- string
- "null"
status:
description: Updated status of the pet
type: string
type:
- string
- "null"
delete:
tags:
- pet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ export default function SchemaItem(props: Props) {
>
{name}
</strong>
<span className="openapi-schema__name"> {schemaName}</span>
<span className="openapi-schema__name">
{Array.isArray(schemaName) ? schemaName.join(" | ") : schemaName}
</span>
{(nullable || required || deprecated) && (
<span className="openapi-schema__divider"></span>
)}
Expand Down

0 comments on commit 6e55849

Please sign in to comment.