Skip to content

Commit ea7328a

Browse files
committed
Fixes #152 Swagger v2 specs with refs were not getting resolved when using SwaggerClient as the spec parser
1 parent e60ea15 commit ea7328a

File tree

7 files changed

+16
-8
lines changed

7 files changed

+16
-8
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

18 Bytes
Binary file not shown.

dist/report.html

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

docs/examples/demo.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777

7878
if(!specUrl) {
7979
specUrl = '../specs/petstore.json'
80+
// specUrl = '../specs/petstore_extended.yaml'
8081
}
8182
rapidocEl.setAttribute('render-style', 'read');
8283
console.log('render-style must be read , actually value is %s', rapidocEl.getAttribute('render-style'));

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": "7.4.1",
3+
"version": "7.4.2",
44
"description": "RapiDoc - Open API spec viewer with built in console",
55
"author": "Mrinmoy Majumdar <[email protected]>",
66
"repository": {

src/utils/spec-parser.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ export default async function ProcessSpec(specUrl, sortTags = false, sortEndpoin
1111
// const specLocation = '';
1212
// let url;
1313

14-
const convertOptions = { patch: true, warnOnly: true };
14+
const convertOptions = {
15+
patch: true,
16+
warnOnly: true,
17+
resolveInternal: true,
18+
resolve: true,
19+
};
20+
1521
try {
1622
let specObj;
1723
if (typeof specUrl === 'string') {
@@ -24,6 +30,7 @@ export default async function ProcessSpec(specUrl, sortTags = false, sortEndpoin
2430
convertedSpec = await converter.convertObj(specObj.spec, convertOptions);
2531
jsonParsedSpec = convertedSpec.openapi;
2632
}
33+
2734
/*
2835
// JsonRefs cant load yaml files, so first use converter
2936
if (typeof specUrl === 'string') {

0 commit comments

Comments
 (0)