diff --git a/src/index.js b/src/index.js index 5d63267d3..7487924f3 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,4 @@ +/* eslint-disable camelcase */ import Url from 'url'; import Http, { makeHttp, serializeRes, serializeHeaders } from './http/index.js'; @@ -7,6 +8,12 @@ import resolveSubtree from './subtree-resolver/index.js'; import { makeApisTagOperation } from './interfaces.js'; import { execute, buildRequest, baseUrl } from './execute/index.js'; import { opId } from './helpers/index.js'; +import HttpResolverSwaggerClient from './resolver/apidom/reference/resolve/resolvers/http-swagger-client/index.js'; +import JsonParser from './resolver/apidom/reference/parse/parsers/json/index.js'; +import YamlParser from './resolver/apidom/reference/parse/parsers/yaml-1-2/index.js'; +import OpenApiJson3_1Parser from './resolver/apidom/reference/parse/parsers/openapi-json-3-1/index.js'; +import OpenApiYaml3_1Parser from './resolver/apidom/reference/parse/parsers/openapi-yaml-3-1/index.js'; +import OpenApi3_1SwaggerClientDereferenceStrategy from './resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/index.js'; Swagger.http = Http; Swagger.makeHttp = makeHttp.bind(null, Swagger.http); @@ -20,6 +27,22 @@ Swagger.makeApisTagOperation = makeApisTagOperation; Swagger.buildRequest = buildRequest; Swagger.helpers = { opId }; Swagger.getBaseUrl = baseUrl; +Swagger.apidom = { + resolve: { + resolvers: { HttpResolverSwaggerClient }, + }, + parse: { + parsers: { + JsonParser, + YamlParser, + OpenApiJson3_1Parser, + OpenApiYaml3_1Parser, + }, + }, + dereference: { + strategies: { OpenApi3_1SwaggerClientDereferenceStrategy }, + }, +}; function Swagger(url, opts = {}) { // Allow url as a separate argument @@ -107,3 +130,4 @@ Swagger.prototype.applyDefaults = function applyDefaults() { export const { helpers } = Swagger; export default Swagger; +/* eslint-enable camelcase */