Skip to content

Commit 08646f5

Browse files
committed
feat: also support examples for properties
1 parent dcf4b63 commit 08646f5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/docusaurus-plugin-openapi-docs/src/openapi/createSchemaExample.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ function sampleFromProp(
8989
return obj;
9090
}
9191

92+
if (prop.example !== undefined) {
93+
return prop.example;
94+
}
95+
if (prop.examples !== undefined) {
96+
return prop.examples[0];
97+
}
98+
9299
// TODO: handle discriminators
93100

94101
if (prop.oneOf) {

0 commit comments

Comments
 (0)