MCPcopy
hub / github.com/acacode/swagger-typescript-api

github.com/acacode/swagger-typescript-api @v13.12.4 sqlite

repository ↗ · DeepWiki ↗ · release v13.12.4 ↗
266 symbols 1,201 edges 145 files 4 documented · 2%
README

Swagger TypeScript API

  • Support for OpenAPI 3.0, 2.0, JSON and YAML
  • Generate the API Client for Fetch or Axios from an OpenAPI Specification

Any questions you can ask here: https://github.com/acacode/swagger-typescript-api/discussions

Examples

All examples you can find here: https://github.com/acacode/swagger-typescript-api/tree/main/tests

Usage

You can use this package in two ways:

CLI

npx swagger-typescript-api generate --path ./swagger.json

Or install locally in your project:

npm install --save-dev swagger-typescript-api
npx swagger-typescript-api generate --path ./swagger.json

Library

npm install --save-dev swagger-typescript-api
import * as path from "node:path";
import * as process from "node:process";
import { generateApi } from "swagger-typescript-api";

await generateApi({ input: path.resolve(process.cwd(), "./swagger.json") });

For more detailed configuration options, please consult the documentation.

Mass media

License

Licensed under the MIT License.

Extension points exported contracts — how you extend this code

GenerateApiParamsFromPath (Interface)
(no doc)
types/index.ts
SwaggerSchemas (Interface)
(no doc)
src/swagger-schema-resolver.ts
RefDetails (Interface)
(no doc)
src/resolved-swagger-schema.ts
TranslatorIO (Interface)
(no doc)
src/translators/translator.ts
SchemaParserConfig (Interface)
(no doc)
src/schema-parser/mono-schema-parser.ts
RemoteSchemaFetchPolicy (Interface)
(no doc)
src/util/remote-schema-fetch.ts
InternalHit (Interface)
(no doc)
tests/resolved-swagger-schema-ssrf.test.ts
AttackerHit (Interface)
(no doc)
tests/resolved-swagger-schema-auth.test.ts

Core symbols most depended-on inside this repo

resolve
called by 139
src/util/name-resolver.ts
readFile
called by 113
src/code-formatter.ts
generateApi
called by 110
src/index.ts
filter
called by 25
src/schema-components-map.ts
parseSchemaContent
called by 13
src/util/parse-schema-content.ts
parse
called by 12
src/schema-parser/mono-schema-parser.ts
download
called by 10
src/util/request.ts
isHttpUrl
called by 9
src/resolved-swagger-schema.ts

Shape

Method 112
Class 70
Function 58
Interface 24
Enum 2

Languages

TypeScript100%

Modules by API surface

src/resolved-swagger-schema.ts34 symbols
src/schema-components-map.ts19 symbols
types/index.ts18 symbols
src/code-formatter.ts15 symbols
src/util/remote-schema-fetch.ts12 symbols
src/swagger-schema-resolver.ts11 symbols
src/util/name-resolver.ts7 symbols
src/util/parse-schema-content.ts6 symbols
src/schema-routes/schema-routes.ts6 symbols
src/translators/translator.ts5 symbols
src/schema-parser/mono-schema-parser.ts5 symbols
src/schema-parser/base-schema-parsers/enum.ts5 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

Dependencies from manifests, versioned

@apidevtools/swagger-parser12.1.0 · 1×
@biomejs/biome2.5.2 · 1×
@biomejs/js-api6.0.0 · 1×
@biomejs/wasm-nodejs2.5.2 · 1×
@changesets/changelog-github0.7.0 · 1×
@changesets/cli2.31.0 · 1×
@tsconfig/node2020.1.9 · 1×
@tsconfig/strictest2.0.8 · 1×
@types/node26.0.0 · 1×
@types/swagger-schema-official2.0.25 · 1×
@types/swagger2openapi7.0.4 · 1×
axios1.18.0 · 1×

For agents

$ claude mcp add swagger-typescript-api \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact