Skip to content

Commit

Permalink
Fixed server-url issues and response with plain-text content-type
Browse files Browse the repository at this point in the history
  • Loading branch information
mrin9 committed May 29, 2019
1 parent 1b0db2e commit 7f22f69
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 18 deletions.
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-->

<rapi-doc
spec-url="./examples/specs/petstore3.yaml"
spec-url="./examples/specs/petstore.json"
layout="row"
theme="dark"
>
Expand Down
Binary file modified dist/index.html.gz
Binary file not shown.
10 changes: 5 additions & 5 deletions dist/rapidoc-min.js

Large diffs are not rendered by default.

Binary file modified dist/rapidoc-min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/rapidoc-min.js.map

Large diffs are not rendered by default.

Binary file modified dist/rapidoc-min.js.map.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/report.html

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/rapidoc-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-->

<rapi-doc
spec-url="./examples/specs/petstore3.yaml"
spec-url="./examples/specs/petstore.json"
layout="row"
theme="dark"
>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rapidoc",
"version": "5.0.3",
"version": "5.0.4",
"description": "RapiDoc - Open API spec viewer with built in console",
"author": "Mrinmoy Majumdar <[email protected]>",
"repository": {
Expand Down
5 changes: 5 additions & 0 deletions src/components/api-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,11 @@ export default class ApiRequest extends LitElement {
me.responseBlobUrl = URL.createObjectURL(respBlob);
})
}
else {
resp.text().then(function(respText) {
me.responseText = respText;
})
}
}
else{
resp.text().then(function(respText) {
Expand Down
15 changes: 12 additions & 3 deletions src/utils/parse-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,22 @@ export default async function ProcessSpec(specUrl){
securitySchemes = (openApiSpec.components? openApiSpec.components.securitySchemes:{});
if (openApiSpec.servers){
openApiSpec.servers.map(function(v){
if (v.url && v.url.substr(0,1) === "/"){
let paths = specUrl.split("/");
v.url = paths[0]+"//"+paths[2]+v.url;
let tempUrl = v.url.trim().toLowerCase();
if (v.url && tempUrl.substr(0,4) !== 'http') {
if (tempUrl.substr(0,2)=='//') {
v.url = location.protocol + v.url;
}
else{
v.url = location.origin + v.url;
}
}
})
}
else{
openApiSpec.servers = [{'url':location.origin}];
}
servers = openApiSpec.servers;

tags.sort((a, b) => (a.name < b.name ? -1 : (a.name > b.name ? 1: 0)) );
let parsedSpec = {
"info" : openApiSpec.info,
Expand Down

0 comments on commit 7f22f69

Please sign in to comment.