Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/poor-bats-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@gitbook/react-openapi': minor
---

Display pattern if available in parmas in OpenAPI block
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@
@apply prose-sm mt-2 text-dark/10 dark:text-light/10;
}

.openapi-schema-pattern {
@apply prose-sm mt-2 text-dark/10 dark:text-light/10;
}

/** Authentication */

.openapi-securities {
Expand Down
5 changes: 5 additions & 0 deletions packages/react-openapi/src/OpenAPISchema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ export function OpenAPISchemaProperty(
Example: <code>{JSON.stringify(schema.example)}</code>
</span>
) : null}
{schema.pattern ? (
<div className="openapi-schema-pattern">
Pattern: <code>{schema.pattern}</code>
</div>
) : null}
</div>
}
>
Expand Down