Skip to content

Commit

Permalink
Fix display of parameter's description in OpenAPI block (#2258)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamyPesse authored Apr 1, 2024
1 parent f26ab0c commit c1ef7f2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/react-openapi/src/OpenAPISpec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ export function OpenAPISpec(props: { rawData: any; context: OpenAPIClientContext
<OpenAPISchemaProperties
properties={group.parameters.map((parameter) => ({
propertyName: parameter.name,
schema: noReference(parameter.schema) ?? {},
schema: {
// Description of the parameter is defined at the parameter level
// we use display it if the schema doesn't override it
description: parameter.description,
...(noReference(parameter.schema) ?? {}),
},
required: parameter.required,
}))}
context={context}
Expand Down

0 comments on commit c1ef7f2

Please sign in to comment.