Skip to content

Commit

Permalink
generated build for 2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mrin9 committed Apr 5, 2020
1 parent 7f46d22 commit 6a8055c
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 104 deletions.
47 changes: 3 additions & 44 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -1,48 +1,7 @@
<!doctype html>
<html lang="en">

<head>
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
<title>RapiPdf</title>
<style>
rapi-pdf {
<!doctype html><html lang="en"><head><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,user-scalable=yes"><title>RapiPdf</title><style>rapi-pdf {
margin:2px;
width:600px;
}
</style>
</head>

<body>
<!--
Some sample spec to try
http://10.21.83.83:8080/api/swagger.json
https://api.apis.guru/v2/specs/stripe.com/2019-08-14/swagger.json
https://api.apis.guru/v2/specs/github.com/v3/swagger.json
https://api.apis.guru/v2/specs/bitbucket.org/2.0/swagger.json
https://petstore.swagger.io/v2/swagger.json
https://assets.zuora.com/zuora-documentation/swagger.yaml <<< Large spec with lot of markdown
-->

<!--
<rapi-pdf id='rapipdf' spec-url="./examples/specs/test.json" include-info="false" include-security="false" include-toc="false"> </rapi-pdf>
-->
<rapi-pdf id='rapipdf' spec-url="./specs/petstore.json" pdf-schema-style="table"> </rapi-pdf>
<rapi-pdf id='rapipdf' spec-url="./specs/petstore.json" pdf-schema-style="object"> </rapi-pdf>
<rapi-pdf id='rapipdf' spec-url="./specs/bitbucket.json"> </rapi-pdf>
<rapi-pdf id='rapipdf' spec-url="./specs/data-types.yaml"> </rapi-pdf>
<rapi-pdf id='rapipdf' spec-url="./specs/data-types.yaml" include-example="true", button-label="WITH EXAMPLE"> </rapi-pdf>
<rapi-pdf id='rapipdf' spec-url="./specs/data-types.yaml" hide-input="true"> </rapi-pdf>


<button onclick="changeSpec()">Change Spec</button>
<script type="text/javascript">
function changeSpec(){
}</style></head><body><rapi-pdf id="rapipdf" spec-url="./specs/petstore.json" pdf-schema-style="table"></rapi-pdf><rapi-pdf id="rapipdf" spec-url="./specs/petstore.json" pdf-schema-style="object"></rapi-pdf><rapi-pdf id="rapipdf" spec-url="./specs/bitbucket.json"></rapi-pdf><rapi-pdf id="rapipdf" spec-url="./specs/data-types.yaml"></rapi-pdf><rapi-pdf id="rapipdf" spec-url="./specs/data-types.yaml" include-example="true" , button-label="WITH EXAMPLE"></rapi-pdf><rapi-pdf id="rapipdf" spec-url="./specs/data-types.yaml" hide-input="true"></rapi-pdf><button onclick="changeSpec()">Change Spec</button><script>function changeSpec(){
let el = document.getElementById("rapipdf");
el.setAttribute('spec-url', 'set new attrib');
}
</script>


<script type="text/javascript" src="rapipdf-min.js"></script></body>

</html>
}</script><script src="rapipdf-min.js"></script></body></html>
Binary file modified dist/index.html.gz
Binary file not shown.
22 changes: 11 additions & 11 deletions dist/rapipdf-min.js

Large diffs are not rendered by default.

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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/rapipdf-min.js.map.gz
Binary file not shown.
26 changes: 6 additions & 20 deletions dist/report.html

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions docs/rapipdf-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rapipdf",
"version": "2.1.1",
"version": "2.2.1",
"description": "RapiPdf - Generate PDF from Open API spec",
"author": "Mrinmoy Majumdar <[email protected]>",
"repository": {
Expand Down
36 changes: 20 additions & 16 deletions src/spec-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default async function ProcessSpec(specUrl, sortTags) {
if (typeof specUrl === 'string') {
specObj = await Swagger(specUrl);
} else {
specObj = { spec: specUrl };
specObj = await Swagger({ spec: specUrl });
}
jsonParsedSpec = specObj.spec;
if (specObj.spec.swagger) {
Expand Down Expand Up @@ -129,27 +129,31 @@ export default async function ProcessSpec(specUrl, sortTags) {
finalParameters = fullPath.parameters ? fullPath.parameters.slice(0) : [];
}

const pathObj = {
summary,
method: methodName,
description: fullPath.description,
path,
operationId: fullPath.operationId,
requestBody: fullPath.requestBody,
parameters: finalParameters,
servers: fullPath.servers ? commonPathProp.servers.concat(fullPath.servers) : commonPathProp.servers,
responses: fullPath.responses,
deprecated: fullPath.deprecated,
security: fullPath.security,
commonSummary: commonPathProp.summary,
commonDescription: commonPathProp.description,
};

if (fullPath.tags) {
fullPath.tags.forEach((mtag) => {
const mtagObj = tags.find((v) => v.name === mtag);
if (mtagObj) {
mtagObj.paths.push({
summary,
method: methodName,
description: fullPath.description,
path,
operationId: fullPath.operationId,
requestBody: fullPath.requestBody,
parameters: finalParameters,
servers: fullPath.servers ? commonPathProp.servers.concat(fullPath.servers) : commonPathProp.servers,
responses: fullPath.responses,
deprecated: fullPath.deprecated,
security: fullPath.security,
commonSummary: commonPathProp.summary,
commonDescription: commonPathProp.description,
});
mtagObj.paths.push(pathObj);
}
});
} else {
tagObj.paths.push(pathObj);
}
totalPathCount++;
}
Expand Down

0 comments on commit 6a8055c

Please sign in to comment.