Compare commits

...

3 Commits

Author SHA1 Message Date
Vib Bhardwaj 0fac399b3f Add lockfile 2024-05-14 17:18:41 +02:00
Vib Bhardwaj 1d8875416b Remove console log 2024-05-14 17:13:25 +02:00
Vib Bhardwaj 24a889cf50 Add support for examples in the OpenAPI block 2024-05-14 17:12:18 +02:00
3 changed files with 6 additions and 0 deletions
BIN
View File
Binary file not shown.
@@ -14,6 +14,7 @@ interface OpenAPISchemaPropertyEntry {
propertyName?: string;
required?: boolean;
schema: OpenAPIV3.SchemaObject;
example?: string;
}
/**
@@ -92,6 +93,10 @@ export function OpenAPISchemaProperty(
className="openapi-schema-description"
/>
) : null}
{schema.example ? (<Markdown
source={'Example: ' + schema.example}
className="openapi-schema-description"
/>) : null}
</div>
}
>
@@ -48,6 +48,7 @@ export function OpenAPISpec(props: { rawData: any; context: OpenAPIClientContext
// Description of the parameter is defined at the parameter level
// we use display it if the schema doesn't override it
description: parameter.description,
example: parameter.example,
...(noReference(parameter.schema) ?? {}),
},
required: parameter.required,