Skip to content

Commit 6a8055c

Browse files
committed
generated build for 2.2.1
1 parent 7f46d22 commit 6a8055c

10 files changed

+53
-104
lines changed

dist/index.html

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,7 @@
1-
<!doctype html>
2-
<html lang="en">
3-
4-
<head>
5-
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
6-
<title>RapiPdf</title>
7-
<style>
8-
rapi-pdf {
1+
<!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 {
92
margin:2px;
103
width:600px;
11-
}
12-
</style>
13-
</head>
14-
15-
<body>
16-
<!--
17-
Some sample spec to try
18-
http://10.21.83.83:8080/api/swagger.json
19-
https://api.apis.guru/v2/specs/stripe.com/2019-08-14/swagger.json
20-
https://api.apis.guru/v2/specs/github.com/v3/swagger.json
21-
https://api.apis.guru/v2/specs/bitbucket.org/2.0/swagger.json
22-
https://petstore.swagger.io/v2/swagger.json
23-
https://assets.zuora.com/zuora-documentation/swagger.yaml <<< Large spec with lot of markdown
24-
-->
25-
26-
<!--
27-
<rapi-pdf id='rapipdf' spec-url="./examples/specs/test.json" include-info="false" include-security="false" include-toc="false"> </rapi-pdf>
28-
-->
29-
<rapi-pdf id='rapipdf' spec-url="./specs/petstore.json" pdf-schema-style="table"> </rapi-pdf>
30-
<rapi-pdf id='rapipdf' spec-url="./specs/petstore.json" pdf-schema-style="object"> </rapi-pdf>
31-
<rapi-pdf id='rapipdf' spec-url="./specs/bitbucket.json"> </rapi-pdf>
32-
<rapi-pdf id='rapipdf' spec-url="./specs/data-types.yaml"> </rapi-pdf>
33-
<rapi-pdf id='rapipdf' spec-url="./specs/data-types.yaml" include-example="true", button-label="WITH EXAMPLE"> </rapi-pdf>
34-
<rapi-pdf id='rapipdf' spec-url="./specs/data-types.yaml" hide-input="true"> </rapi-pdf>
35-
36-
37-
<button onclick="changeSpec()">Change Spec</button>
38-
<script type="text/javascript">
39-
function changeSpec(){
4+
}</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(){
405
let el = document.getElementById("rapipdf");
416
el.setAttribute('spec-url', 'set new attrib');
42-
}
43-
</script>
44-
45-
46-
<script type="text/javascript" src="rapipdf-min.js"></script></body>
47-
48-
</html>
7+
}</script><script src="rapipdf-min.js"></script></body></html>

dist/index.html.gz

-255 Bytes
Binary file not shown.

dist/rapipdf-min.js

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

dist/rapipdf-min.js.gz

-2.54 KB
Binary file not shown.

dist/rapipdf-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/rapipdf-min.js.map.gz

0 Bytes
Binary file not shown.

dist/report.html

Lines changed: 6 additions & 20 deletions
Large diffs are not rendered by default.

docs/rapipdf-min.js

Lines changed: 11 additions & 11 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": "rapipdf",
3-
"version": "2.1.1",
3+
"version": "2.2.1",
44
"description": "RapiPdf - Generate PDF from Open API spec",
55
"author": "Mrinmoy Majumdar <mrin9@yahoo.com>",
66
"repository": {

src/spec-parser.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default async function ProcessSpec(specUrl, sortTags) {
1111
if (typeof specUrl === 'string') {
1212
specObj = await Swagger(specUrl);
1313
} else {
14-
specObj = { spec: specUrl };
14+
specObj = await Swagger({ spec: specUrl });
1515
}
1616
jsonParsedSpec = specObj.spec;
1717
if (specObj.spec.swagger) {
@@ -129,27 +129,31 @@ export default async function ProcessSpec(specUrl, sortTags) {
129129
finalParameters = fullPath.parameters ? fullPath.parameters.slice(0) : [];
130130
}
131131

132+
const pathObj = {
133+
summary,
134+
method: methodName,
135+
description: fullPath.description,
136+
path,
137+
operationId: fullPath.operationId,
138+
requestBody: fullPath.requestBody,
139+
parameters: finalParameters,
140+
servers: fullPath.servers ? commonPathProp.servers.concat(fullPath.servers) : commonPathProp.servers,
141+
responses: fullPath.responses,
142+
deprecated: fullPath.deprecated,
143+
security: fullPath.security,
144+
commonSummary: commonPathProp.summary,
145+
commonDescription: commonPathProp.description,
146+
};
147+
132148
if (fullPath.tags) {
133149
fullPath.tags.forEach((mtag) => {
134150
const mtagObj = tags.find((v) => v.name === mtag);
135151
if (mtagObj) {
136-
mtagObj.paths.push({
137-
summary,
138-
method: methodName,
139-
description: fullPath.description,
140-
path,
141-
operationId: fullPath.operationId,
142-
requestBody: fullPath.requestBody,
143-
parameters: finalParameters,
144-
servers: fullPath.servers ? commonPathProp.servers.concat(fullPath.servers) : commonPathProp.servers,
145-
responses: fullPath.responses,
146-
deprecated: fullPath.deprecated,
147-
security: fullPath.security,
148-
commonSummary: commonPathProp.summary,
149-
commonDescription: commonPathProp.description,
150-
});
152+
mtagObj.paths.push(pathObj);
151153
}
152154
});
155+
} else {
156+
tagObj.paths.push(pathObj);
153157
}
154158
totalPathCount++;
155159
}

0 commit comments

Comments
 (0)