Skip to content

Commit

Permalink
test(resolver): add tests for OpenAPI 3.1 spec obj resolution
Browse files Browse the repository at this point in the history
Spec object can be provided instead of URL.
If baseDoc or url options are not provided,
default retrival URL is set to http://smartbear.com

Refs #2754
  • Loading branch information
char0n committed Jan 18, 2023
1 parent 7af8ba5 commit a919788
Show file tree
Hide file tree
Showing 3 changed files with 956 additions and 14 deletions.
3 changes: 2 additions & 1 deletion src/resolver/strategies/openapi-3-1.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ const resolveOpenAPI31Strategy = async (options) => {
useCircularStructures = false,
skipNormalization = false,
} = options;
const defaultRetrievalURL = 'https://smartbear.com/';
const openApiElement = OpenApi3_1Element.refract(spec);
const dereferenced = await dereferenceApiDOM(openApiElement, {
resolve: {
baseURI: optionsUtil.retrievalURI(options),
baseURI: optionsUtil.retrievalURI(options) || defaultRetrievalURL,
resolvers: [
HttpResolverSwaggerClient({
timeout: timeout || 10000,
Expand Down
Loading

0 comments on commit a919788

Please sign in to comment.