From 1753df2cf218f9dcf48ac23138d283265c3c7d10 Mon Sep 17 00:00:00 2001 From: "Tomasz Jankowski (Aplikacja)" Date: Thu, 7 Mar 2019 15:58:12 +0100 Subject: [PATCH] Display requestBody description #833 --- src/components/Parameters/Parameters.tsx | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/components/Parameters/Parameters.tsx b/src/components/Parameters/Parameters.tsx index 9f8d4842..9145f13e 100644 --- a/src/components/Parameters/Parameters.tsx +++ b/src/components/Parameters/Parameters.tsx @@ -4,11 +4,12 @@ import { ParametersGroup } from './ParametersGroup'; import { UnderlinedHeader } from '../../common-elements'; +import { MediaContentModel } from '../../services'; import { FieldModel, RequestBodyModel } from '../../services/models'; import { MediaTypesSwitch } from '../MediaTypeSwitch/MediaTypesSwitch'; import { Schema } from '../Schema'; -import { MediaContentModel } from '../../services'; +import { Markdown } from '../Markdown/Markdown'; function safePush(obj, prop, item) { if (!obj[prop]) { @@ -45,13 +46,15 @@ export class Parameters extends React.PureComponent { const bodyContent = body && body.content; + const bodyDescription = body && body.description; + return ( -
+ <> {paramsPlaces.map(place => ( ))} - {bodyContent && } -
+ {bodyContent && } + ); } } @@ -64,12 +67,17 @@ function DropdownWithinHeader(props) { ); } -function BodyContent(props: { content: MediaContentModel }): JSX.Element { - const { content } = props; +function BodyContent(props: { content: MediaContentModel; description?: string }): JSX.Element { + const { content, description } = props; return ( {({ schema }) => { - return ; + return ( + <> + {description !== undefined && } + + + ); }} );