diff --git a/docs/redoc-vendor-extensions.md b/docs/redoc-vendor-extensions.md index 4f012fd2..16909bba 100644 --- a/docs/redoc-vendor-extensions.md +++ b/docs/redoc-vendor-extensions.md @@ -200,6 +200,16 @@ Extends OpenAPI [Parameter Object](http://swagger.io/specification/#parameterObj ###### Usage in ReDoc `x-examples` are rendered in the JSON tab on the right panel of ReDoc. +### Response Object vendor extensions +Extneds OpeanAPI [Response Object](https://swagger.io/specification/#responseObject) + +#### x-summary +| Field Name | Type | Description | +| :------------- | :------: | :---------- | +| x-summary | string | a short summary of the response | + +###### Usage in ReDoc +If specified, `x-summary` is used as the response button text. Description is rendered under the button. ### Schema Object vendor extensions Extends OpenAPI [Schema Object](http://swagger.io/specification/#schemaObject) diff --git a/src/components/Responses/Response.tsx b/src/components/Responses/Response.tsx index 6f521f4b..2404dce5 100644 --- a/src/components/Responses/Response.tsx +++ b/src/components/Responses/Response.tsx @@ -8,6 +8,7 @@ import { DropdownOrLabel } from '../DropdownOrLabel/DropdownOrLabel'; import { MediaTypesSwitch } from '../MediaTypeSwitch/MediaTypesSwitch'; import { Schema } from '../Schema'; +import { Markdown } from '../Markdown/Markdown'; import { ResponseHeaders } from './ResponseHeaders'; import { ResponseDetailsWrap, StyledResponseTitle } from './styled.elements'; @@ -18,11 +19,11 @@ export class ResponseView extends React.Component<{ response: ResponseModel }> { }; render() { - const { headers, type, description, code, expanded, content } = this.props.response; + const { headers, type, summary, description, code, expanded, content } = this.props.response; const mimes = content === undefined ? [] : content.mediaTypes.filter(mime => mime.schema !== undefined); - const empty = headers.length === 0 && mimes.length === 0; + const empty = headers.length === 0 && mimes.length === 0 && !description; return (