swagger-api/swagger-js

Javascript library to connect to swagger-enabled APIs via browser or nodejs

2,694

stars

4,550

commits

JavaScript

primary language

Sep 4, 2026

updated

swagger.io
hacktoberfest
javascript
openapi3
openapi31
openapi32
openapi-specification
open-source
rest
rest-api
swagger
swagger-api
swagger-client
swagger-oss

README

Swagger Client

Build Status

Swagger Client is a JavaScript module that allows you to fetch, resolve, and interact with Swagger/OpenAPI documents.

New!

This is the new version of Swagger Client, 3.x. The new version supports Swagger 2.0 as well as OpenAPI 3.

Want to learn more? Check out our FAQ.

For features known to be missing from 3.x please see the Graveyard.

For the older version of Swagger Client, refer to the 2.x branch.

Compatibility

The OpenAPI Specification has undergone multiple revisions since initial creation in 2010. Compatibility between Swagger Client and the OpenAPI Specification is as follows:

Swagger Client VersionRelease DateOpenAPI Spec compatibilityNotes
3.37.x2026-02-272.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.1.0, 3.2.0tag v3.37.0
3.33.x2024-12-302.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.1.0tag v3.33.0
3.19.x2023-01-232.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.1.0tag v3.19.0-alpha.3
3.10.x2020-01-172.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3tag v3.10.0
2.1.322017-01-121.0, 1.1, 1.2tag v2.1.32. This release is only available on GitHub.

Anonymized analytics

Swagger Client uses Scarf to collect anonymized installation analytics. These analytics help support the maintainers of this library and ONLY run during installation. To opt out, you can set the scarfSettings.enabled field to false in your project's package.json:

// package.json
{
  // ...
  "scarfSettings": {
    "enabled": false
  }
  // ...
}

Alternatively, you can set the environment variable SCARF_ANALYTICS to false as part of the environment that installs your npm packages, e.g., SCARF_ANALYTICS=false npm install.

Documentation

Usage

Development

Migrations

Runtime

Node.js

swagger-client requires Node.js >=22 and uses native Node.js fetch. Node.js 12, 14, 16, 18, and 20 are EOL and are no longer supported.

NOTE: swagger-client minimum Node.js runtime version aligns with Node.js Releases which means that we can drop support for EOL (End Of Life) Node.js versions without doing major version bump.

Browsers

swagger-client works in the latest versions of Chrome, Safari, Firefox, and Edge and uses native fetch implementation provided by each supported browser.

Security contact

Please disclose any security-related issues or vulnerabilities by emailing security@swagger.io, instead of using the public issue tracker.

Contributors

(top 30 of 203)

dependabot[bot]

1,860 commits

fehguy

1,095 commits

shockey

433 commits

char0n

335 commits

swagger-api/swagger-js

Javascript library to connect to swagger-enabled APIs via browser or nodejs

2,694

stars

4,550

commits

JavaScript

primary language

Sep 4, 2026

updated

swagger.io
hacktoberfest
javascript
openapi3
openapi31
openapi32
openapi-specification
open-source
rest
rest-api
swagger
swagger-api
swagger-client
swagger-oss

README

Swagger Client

Build Status

Swagger Client is a JavaScript module that allows you to fetch, resolve, and interact with Swagger/OpenAPI documents.

New!

This is the new version of Swagger Client, 3.x. The new version supports Swagger 2.0 as well as OpenAPI 3.

Want to learn more? Check out our FAQ.

For features known to be missing from 3.x please see the Graveyard.

For the older version of Swagger Client, refer to the 2.x branch.

Compatibility

The OpenAPI Specification has undergone multiple revisions since initial creation in 2010. Compatibility between Swagger Client and the OpenAPI Specification is as follows:

Swagger Client VersionRelease DateOpenAPI Spec compatibilityNotes
3.37.x2026-02-272.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.1.0, 3.2.0tag v3.37.0
3.33.x2024-12-302.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.1.0tag v3.33.0
3.19.x2023-01-232.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.1.0tag v3.19.0-alpha.3
3.10.x2020-01-172.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3tag v3.10.0
2.1.322017-01-121.0, 1.1, 1.2tag v2.1.32. This release is only available on GitHub.

Anonymized analytics

Swagger Client uses Scarf to collect anonymized installation analytics. These analytics help support the maintainers of this library and ONLY run during installation. To opt out, you can set the scarfSettings.enabled field to false in your project's package.json:

// package.json
{
  // ...
  "scarfSettings": {
    "enabled": false
  }
  // ...
}

Alternatively, you can set the environment variable SCARF_ANALYTICS to false as part of the environment that installs your npm packages, e.g., SCARF_ANALYTICS=false npm install.

Documentation

Usage

Development

Migrations

Runtime

Node.js

swagger-client requires Node.js >=22 and uses native Node.js fetch. Node.js 12, 14, 16, 18, and 20 are EOL and are no longer supported.

NOTE: swagger-client minimum Node.js runtime version aligns with Node.js Releases which means that we can drop support for EOL (End Of Life) Node.js versions without doing major version bump.

Browsers

swagger-client works in the latest versions of Chrome, Safari, Firefox, and Edge and uses native fetch implementation provided by each supported browser.

Security contact

Please disclose any security-related issues or vulnerabilities by emailing security@swagger.io, instead of using the public issue tracker.

Contributors

(top 30 of 203)

dependabot[bot]

1,860 commits

fehguy

1,095 commits

shockey

433 commits

char0n

335 commits

Languages

JavaScript

100.0%