@hyperone/cli-core
Advanced tools
Comparing version 1.0.14 to 1.0.16
import fetch from 'node-fetch'; | ||
import $RefParser from '@apidevtools/json-schema-ref-parser'; | ||
import {lazy_resolver} from './json_schema'; | ||
@@ -14,10 +15,17 @@ const spec = {}; | ||
let schema; | ||
const openapiUrl = options.openapiUrl || 'https://api.hyperone.com/v2/openapi.json'; | ||
if (options.openapiSpec) { | ||
schema = options.openapiSpec; | ||
} else { | ||
const url = options.openapiUrl || 'https://api.hyperone.com/v2/openapi.json'; | ||
const resp = await fetch(url); | ||
const resp = await fetch(openapiUrl); | ||
schema = await resp.json(); | ||
} | ||
Object.assign(spec, await $RefParser.dereference(schema)); | ||
Object.assign(spec, await $RefParser.dereference(schema, { | ||
resolve: { | ||
lazy: lazy_resolver(openapiUrl), | ||
file: false, | ||
http: false, | ||
}, | ||
})); | ||
}, | ||
@@ -24,0 +32,0 @@ getNamespaces: () => { |
{ | ||
"name": "@hyperone/cli-core", | ||
"version": "1.0.14", | ||
"version": "1.0.16", | ||
"description": "", | ||
@@ -29,3 +29,3 @@ "main": "index.js", | ||
"license": "MIT", | ||
"gitHead": "89c15fc66c5ac441bd909c77bb9e05fc8eb433ef" | ||
"gitHead": "f965f99bb528f0d8a3aa513fe37d64627c6361d9" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26445
20
668
3