How to use jsonref - 5 common examples

To help you get started, we’ve selected a few jsonref examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vivocha / arrest / lib / api.js View on Github external
_.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);
github vivocha / arrest / lib / api.js View on Github external
_.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);
github vivocha / arrest / src / schema.js View on Github external
export function resolve(dataOrUri, opts) {
  return jr.parse(dataOrUri, _.defaults(opts, {
    store: _store,
    retriever: defaultRetriever
  }));
}
export function create(dataOrUri, opts) {
github vivocha / arrest / src / api.ts View on Github external
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;
      })();
    }
github vivocha / arrest / src / api.ts View on Github external
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) {

jsonref

Javascript References ($ref) and Pointers library

MIT
Latest version published 6 months ago

Package Health Score

61 / 100
Full package analysis