Skip to content

Commit

Permalink
fix: defer optional removal of x-miro to end of resolution steps, refs
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeRalphson committed Feb 18, 2019
1 parent bd82b50 commit aabd716
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/oas-resolver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ function resolveAllFragment(obj, context, src, parentPath, base, options) {
recurse(obj,{},function(obj,key,state){
if (isRef(obj, key)) {
if (typeof obj.$fixed !== 'undefined') delete obj.$fixed;
if (!options.preserveMiro) delete obj['x-miro'];
}
});

Expand Down Expand Up @@ -426,6 +425,11 @@ function loopReferences(options, res, rej) {
options.openapi = deRef(options.openapi,options.original,{verbose:options.verbose-1});
if (options.verbose>1) console.warn(common.colour.yellow+'Finished internal resolution!',common.colour.normal);
}
recurse(options.openapi,{},function(obj,key,state){
if (isRef(obj, key)) {
if (!options.preserveMiro) delete obj['x-miro'];
}
});
res(options);
}
}
Expand Down

0 comments on commit aabd716

Please sign in to comment.