Skip to content

Commit 52e2852

Browse files
committed
minor lit ifdefined check added
1 parent 99e216f commit 52e2852

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎packages/rapidoc/src/templates/request-body-template.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { html } from 'lit';
55
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
66
import { live } from 'lit/directives/live.js';
77
import { repeat } from 'lit/directives/repeat.js';
8+
import { ifDefined } from 'lit/directives/if-defined.js';
89
import { sanitizeHTML } from '../utils/sanitize.js';
910
import { marked } from 'marked';
1011
import { schemaToAST, getTypeInfo, isBinaryFileField, generateExample, normalizeExamples, standardizeExample } from '~/utils/schema-utils';
@@ -510,7 +511,7 @@ ${v.exampleFormat === 'text' ? v.exampleValue : JSON.stringify(v.exampleValue, n
510511
});
511512

512513
return html`
513-
<div class="request-body-container" data-selected-request-body-type="${this.selectedRequestBodyType}">
514+
<div class="request-body-container" data-selected-request-body-type="${ifDefined(this.selectedRequestBodyType)}">
514515
<div class="table-title top-gap row">
515516
REQUEST BODY ${this.request_body.required ? html`<span class="mono-font" style="color:var(--red)">*</span>` : ''}
516517
<span style="font-weight:normal; margin-left:5px"> ${this.selectedRequestBodyType}</span>

0 commit comments

Comments
 (0)