We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5cf94fd commit a62daceCopy full SHA for a62dace
packages/docusaurus-plugin-openapi-docs/src/openapi/createSchemaExample.ts
@@ -91,7 +91,11 @@ function sampleFromProp(
91
92
// TODO: handle discriminators
93
94
- if (prop.oneOf) {
+ if (prop.example !== undefined) {
95
+ obj[name] = prop.example;
96
+ } else if (prop.examples !== undefined && prop.examples.length > 0) {
97
+ obj[name] = prop.examples[0];
98
+ } else if (prop.oneOf) {
99
obj[name] = sampleFromSchema(prop.oneOf[0], context);
100
} else if (prop.anyOf) {
101
obj[name] = sampleFromSchema(prop.anyOf[0], context);
0 commit comments