Skip to content

Commit a9c2312

Browse files
committed
Fixed : multiple url-encoding, incorrect querystring appender
1 parent 7f22f69 commit a9c2312

File tree

11 files changed

+19
-19
lines changed

11 files changed

+19
-19
lines changed

dist/rapidoc-min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rapidoc-min.js.gz

2 Bytes
Binary file not shown.

dist/rapidoc-min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rapidoc-min.js.map.gz

1 Byte
Binary file not shown.

dist/report.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/rapidoc-min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rapidoc",
3-
"version": "5.0.4",
3+
"version": "5.0.5",
44
"description": "RapiDoc - Open API spec viewer with built in console",
55
"author": "Mrinmoy Majumdar <[email protected]>",
66
"repository": {

src/components/api-request.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export default class ApiRequest extends LitElement {
224224
225225
</td>
226226
<td colspan="2" style="border:none; margin-top:0; padding:0 5px;">
227-
<span class="m-markdown-small">${unsafeHTML(marked(param.description))}</span>
227+
<span class="m-markdown-small">${unsafeHTML(marked(param.description || ""))}</span>
228228
</td>
229229
</tr>`
230230
:``}
@@ -251,7 +251,7 @@ export default class ApiRequest extends LitElement {
251251

252252
let mimeReqCount=0;
253253
let shortMimeTypes={};
254-
let bodyDescrHtml = this.request_body.description? html`<div class="m-markdown"> ${unsafeHTML(marked(this.request_body.description))}</div>`:'';
254+
let bodyDescrHtml = this.request_body.description? html`<div class="m-markdown"> ${unsafeHTML(marked(this.request_body.description || ""))}</div>`:'';
255255
let textareaExampleHtml='';
256256
let formDataHtml='';
257257
const formDataTableRows = [];
@@ -335,7 +335,7 @@ export default class ApiRequest extends LitElement {
335335
<tr>
336336
<td style="border:none"></td>
337337
<td colspan="2" style="border:none; margin-top:0; padding:0 5px;">
338-
<span class="m-markdown-small">${unsafeHTML(marked(fieldSchema.description))}</span>
338+
<span class="m-markdown-small">${unsafeHTML(marked(fieldSchema.description || ""))}</span>
339339
</td>
340340
</tr>`
341341
:``}
@@ -487,7 +487,7 @@ export default class ApiRequest extends LitElement {
487487
}
488488
//Generate URL using Path Params
489489
pathParamEls.map(function(el){
490-
fetchUrl = fetchUrl.replace("{"+el.dataset.pname+"}", encodeURIComponent(el.value));
490+
fetchUrl = fetchUrl.replace("{"+el.dataset.pname+"}", el.value);
491491
});
492492

493493
//Submit Query Params
@@ -496,13 +496,13 @@ export default class ApiRequest extends LitElement {
496496
queryParamEls.map(function(el){
497497
if (el.dataset.array==='false'){
498498
if (el.value !== ''){
499-
queryParam.append(el.dataset.pname, encodeURIComponent(el.value));
499+
queryParam.append(el.dataset.pname, el.value);
500500
}
501501
}
502502
else {
503503
let vals = el.getValues();
504504
for(let v of vals){
505-
queryParam.append(el.dataset.pname, encodeURIComponent(v));
505+
queryParam.append(el.dataset.pname, v);
506506
}
507507
}
508508
})
@@ -511,7 +511,7 @@ export default class ApiRequest extends LitElement {
511511

512512
// Add authentication Query-Param if provided
513513
if (this.apiKeyValue && this.apiKeyName && this.apiKeyLocation==='query'){
514-
fetchUrl = `${fetchUrl}&${this.apiKeyName}=${encodeURIComponent(this.apiKeyValue)}`;
514+
fetchUrl = `${fetchUrl}${fetchUrl.includes("?")?'&':'?'}${this.apiKeyName}=${encodeURIComponent(this.apiKeyValue)}`;
515515
}
516516

517517
//Final URL for API call

src/components/api-response.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export default class ApiResponse extends LitElement {
179179
<tr>
180180
<td style="padding:0 12px;vertical-align: top;" class="regular-font-size"> ${v.name}</td>
181181
<td style="padding:0 12px;vertical-align: top; line-height:14px" class="descr-text small-font-size">
182-
<span class="m-markdown-small">${unsafeHTML(marked(v.description))}</span>
182+
<span class="m-markdown-small">${unsafeHTML(marked(v.description || "" ))}</span>
183183
${ (v.schema && v.schema.example)? html`<br/><span style="font-weight:bold">EXAMPLE:</span> ${v.schema.example}`:`` }
184184
</td>
185185
</tr>

src/components/end-point.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ export default class EndPoint extends LitElement {
3333
<div class="path ${this.path.deprecated?'deprecated':''}"> ${this.path.path} </div>
3434
${this.path.deprecated?html`<span style="font-size:12px; text-transform:uppercase; font-weight:bold; color:orangered; margin:2px 0 0 5px;"> deprecated </span>`:''}
3535
<div class="only-large-screen" style="min-width:60px; flex:1"></div>
36-
<div class="m-markdown-small descr"> ${unsafeHTML(marked(this.path.summary))} </div>
36+
<div class="m-markdown-small descr"> ${unsafeHTML(marked(this.path.summary || ""))} </div>
3737
</div>
3838
3939
<!-- Endpoint Body -->
4040
${this.path.expanded?html`
4141
<div class='body ${this.path.method}'>
4242
${this.path.summary || this.path.description?html`
4343
<div class="summary">
44-
<div class="m-markdown title">${unsafeHTML(marked(this.path.summary))}</div>
44+
<div class="m-markdown title">${unsafeHTML(marked(this.path.summary || ""))}</div>
4545
${this.path.summary !== this.path.description?html`
4646
<div class="m-markdown">
47-
${unsafeHTML(marked(this.path.description?this.path.description:''))}
47+
${unsafeHTML(marked(this.path.description || ""))}
4848
</div>`
4949
:''}
5050
</div>`

0 commit comments

Comments
 (0)