Catalog npm
Back to packageRELEASE DETAILS

1.1.2

npm

@0x-jerry/openapi-ts

This package provide a quick way to transform OpenAPI schema or Swagger schema to client typescript code.

Published12 Feb 2024
Direct dependencies18
Transitive dependenciesNot calculated

README

Current package documentation

OpenAPI Code Generator

This package provide a quick way to transform OpenAPI schema or Swagger schema to client typescript code.

Usage

  1. Generate client typescript code
import { generate } from '@0x-jerry/openapi-ts'

const apiUrl = 'http://doc-url/api-docs'

const swaggerSchema = await (await fetch(apiUrl)).json()

await generate({
  schema: swaggerSchema,
  output: 'api',
  format: true,
  clean: true,
  adapter: 'axios'
})
  1. Change adapter file api/_adapter.ts to suit your needs.

  2. Use generated code

import * as api from './api/generated'

const resp = await api.segment.to.path.$get({...})

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 20

Native requirements
18 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
memfs
Environment
{
  "local_name": "memfs",
  "alias": false,
  "peer_metadata": null
}
^4.6.0runtime
lodash-es
Environment
{
  "local_name": "lodash-es",
  "alias": false,
  "peer_metadata": null
}
^4.17.21runtime
@biomejs/biome
Environment
{
  "local_name": "@biomejs/biome",
  "alias": false,
  "peer_metadata": null
}
^1.5.3runtime
quicktype-core
Environment
{
  "local_name": "quicktype-core",
  "alias": false,
  "peer_metadata": null
}
^23.0.81runtime
@0x-jerry/utils
Environment
{
  "local_name": "@0x-jerry/utils",
  "alias": false,
  "peer_metadata": null
}
^2.1.1runtime
swagger2openapi
Environment
{
  "local_name": "swagger2openapi",
  "alias": false,
  "peer_metadata": null
}
^7.0.8runtime
openapi-typescript
Environment
{
  "local_name": "openapi-typescript",
  "alias": false,
  "peer_metadata": null
}
^6.7.4runtime
ky
Environment
{
  "local_name": "ky",
  "alias": false,
  "peer_metadata": null
}
^1.2.0development
tsx
Environment
{
  "local_name": "tsx",
  "alias": false,
  "peer_metadata": null
}
^4.7.0development
tsup
Environment
{
  "local_name": "tsup",
  "alias": false,
  "peer_metadata": null
}
^8.0.1development
axios
Environment
{
  "local_name": "axios",
  "alias": false,
  "peer_metadata": null
}
^1.6.7development
vitest
Environment
{
  "local_name": "vitest",
  "alias": false,
  "peer_metadata": null
}
1.2.2development
@vitest/ui
Environment
{
  "local_name": "@vitest/ui",
  "alias": false,
  "peer_metadata": null
}
^1.2.2development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.3.3development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^20.11.16development
@types/lodash-es
Environment
{
  "local_name": "@types/lodash-es",
  "alias": false,
  "peer_metadata": null
}
^4.17.12development
@0x-jerry/x-release
Environment
{
  "local_name": "@0x-jerry/x-release",
  "alias": false,
  "peer_metadata": null
}
^0.4.0development
@vitest/coverage-v8
Environment
{
  "local_name": "@vitest/coverage-v8",
  "alias": false,
  "peer_metadata": null
}
^1.2.2development
ky
Environment
{
  "local_name": "ky",
  "alias": false,
  "peer_metadata": null
}
^1.2.0optional
axios
Environment
{
  "local_name": "axios",
  "alias": false,
  "peer_metadata": null
}
^1.6.7optional

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "ccbf44d1d68b6f244fb2a11ae209d6f57a757958",
  "tarball": "https://registry.npmjs.org/@0x-jerry/openapi-ts/-/openapi-ts-1.1.2.tgz",
  "fileCount": 6,
  "integrity": "sha512-+fisgAU3FgvqvBfry2xHF0IFdn58vw73C9dksPv4pwyH/AGIvVuriRTtl9u2b3K9cJLEPQxmOpfpvLkOJa6Xuw==",
  "signatures": [
    {
      "sig": "MEQCIEQz8yvxUDNP+jZ+EgjlBJtV1iTdRTk9Xc1zCptW2Qb5AiBy/kQLo5h1EVM7JhqXMxG/iXY1DYd+dNrk0zvPJLfUPg==",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "unpackedSize": 19007
}

Repository

PENDING
0x-jerry/openapi-ts

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:16 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:2976cafb8e7fed35a01cafc41d70cdc32cc47ef8a3b656feb2b0cffac18a3788

Other collected versions

2.0.528 Apr2.0.318 Aug2.0.218 Aug2.0.118 Aug2.0.018 Aug1.5.05 NovView all collected versions →