Skip to content

Commit 3a1fb21

Browse files
fix(Parse): Solve remote references
1 parent fe43877 commit 3a1fb21

File tree

3 files changed

+227
-414
lines changed

3 files changed

+227
-414
lines changed

lib/open-api-mocker.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const jsonRefs = require('json-refs');
3+
const SwaggerParser = require('@apidevtools/swagger-parser');
44

55
const { Parser: OpenApiParser } = require('./openapi');
66
const { Parser: ServersParser } = require('./servers');
@@ -41,9 +41,7 @@ class OpenApiMocker {
4141
this.schema = await this.schema;
4242

4343
try {
44-
const parsedSchemas = await jsonRefs.resolveRefs(this.schema);
45-
46-
this.schema = parsedSchemas.resolved;
44+
this.schema = await SwaggerParser.validate(this.schema);
4745

4846
const openApiParser = new OpenApiParser();
4947
const openapi = openApiParser.parse(this.schema);

0 commit comments

Comments
 (0)