Display pattern if available in OpenAPI params (#2461)

Co-authored-by: Samy Pessé <samypesse@gmail.com>
This commit is contained in:
vibhanshub
2024-09-19 08:59:10 +01:00
committed by GitHub
parent b32e40c72a
commit aa8c49eb0c
3 changed files with 12 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@gitbook/react-openapi': minor
---
Display pattern if available in parmas in OpenAPI block
@@ -174,7 +174,8 @@
@apply prose-sm;
}
.openapi-schema-example {
.openapi-schema-example,
.openapi-schema-pattern {
@apply prose-sm mt-2 text-dark/10 dark:text-light/10;
}
@@ -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>
}
>