@@ -41,6 +41,10 @@ export class ApiBodyDocumentElement extends AmfHelperMixin(LitElement) {
4141 * type.
4242 */
4343 body : { type : Array } ,
44+ /**
45+ * requestBody description for OAS 3.0 specs
46+ */
47+ bodyDescription : { type : String } ,
4448 /**
4549 * List of discovered media types in the `body`.
4650 */
@@ -203,6 +207,19 @@ export class ApiBodyDocumentElement extends AmfHelperMixin(LitElement) {
203207 this . _bodyChanged ( ) ;
204208 }
205209
210+ get bodyDescription ( ) {
211+ return this . _bodyDescription ;
212+ }
213+
214+ set bodyDescription ( value ) {
215+ const old = this . _bodyDescription ;
216+ if ( old === value ) {
217+ return ;
218+ }
219+ this . _bodyDescription = value ;
220+ this . requestUpdate ( 'bodyDescription' , old ) ;
221+ }
222+
206223 get toggleActionLabel ( ) {
207224 const { opened } = this ;
208225 return opened ? 'Hide' : 'Show' ;
@@ -478,10 +495,12 @@ export class ApiBodyDocumentElement extends AmfHelperMixin(LitElement) {
478495 amf,
479496 narrow,
480497 renderReadOnly,
498+ bodyDescription
481499 } = this ;
482500 const hasBodyName = ! ! _bodyName ;
483501 const hasDescription = ! ! _description ;
484502 const hasTypeName = _typeName && _typeName !== 'default' ;
503+ const hasBodyDescription = ! ! bodyDescription
485504
486505 return html `
487506 < div class ="media-type-selector ">
@@ -490,6 +509,10 @@ export class ApiBodyDocumentElement extends AmfHelperMixin(LitElement) {
490509 this . _mediaTypesTemplate ( ) :
491510 html `< span class ="media-type-label "> ${ _selectedMediaType } </ span > ` }
492511 </ div >
512+ ${ hasBodyDescription ? html `
513+ < arc-marked .markdown ="${ bodyDescription } " sanitize >
514+ < div slot ="markdown-html " class ="markdown-html " part ="markdown-html "> </ div >
515+ </ arc-marked > ` : '' }
493516 ${ hasBodyName ? html `< div class ="body-name type-title "> ${ _bodyName } </ div > ` : '' }
494517 ${ hasTypeName ? html `< div class ="type-title "> ${ _typeName } </ div > ` : '' }
495518 ${ hasDescription ? html `
0 commit comments