Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_.each(originalSwagger.securityDefinitions, function(i, k) {
if (i.authorizationUrl) {
out.securityDefinitions[k].authorizationUrl = jr.normalizeUri(i.authorizationUrl, out.id, true);
}
if (i.tokenUrl) {
out.securityDefinitions[k].tokenUrl = jr.normalizeUri(i.tokenUrl, out.id, true);
}
});
res.json(out);
_.each(originalSwagger.securityDefinitions, function(i, k) {
if (i.authorizationUrl) {
out.securityDefinitions[k].authorizationUrl = jr.normalizeUri(i.authorizationUrl, out.id, true);
}
if (i.tokenUrl) {
out.securityDefinitions[k].tokenUrl = jr.normalizeUri(i.tokenUrl, out.id, true);
}
});
res.json(out);
export function resolve(dataOrUri, opts) {
return jr.parse(dataOrUri, _.defaults(opts, {
store: _store,
retriever: defaultRetriever
}));
}
export function create(dataOrUri, opts) {
for (let j in s.flows) {
const f = s.flows[j];
['authorizationUrl', 'tokenUrl', 'refreshUrl'].forEach(k => {
if (f[k]) {
f[k] = new URL(f[k], baseUrl).toString();
}
});
}
}
}
}
res.json(out);
}
});
this.document = await refs.parse(this.document, this.parseOptions);
for (let resource of this.resources) {
await resource.router(router, options);
}
router.use(this.handleError);
return router;
})();
}
registerSchema(name: string, schema: OpenAPIV3.SchemaObject) {
this.originalSchemas[name] = _.cloneDeep(schema);
if (!this.document.components) {
this.document.components = {};
}
if (!this.document.components.schemas) {
this.document.components.schemas = {};
}
this.document.components.schemas[name] = removeSchemaDeclaration(refs.rebase(name, _.cloneDeep(schema), refsRebaser));
}
registerDynamicSchema(name: string, schema: SchemaObject) {