Catalog npm
Back to packageRELEASE DETAILS

1.0.0

npm

@0x-jerry/openapi-ts

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

Published9 Feb 2024
Direct dependencies15
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 15

Native requirements
15 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
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
vitest
Environment
{
  "local_name": "vitest",
  "alias": false,
  "peer_metadata": null
}
1.2.2development
node-fetch
Environment
{
  "local_name": "node-fetch",
  "alias": false,
  "peer_metadata": null
}
^3.3.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
openapi-typescript
Environment
{
  "local_name": "openapi-typescript",
  "alias": false,
  "peer_metadata": null
}
^6.7.4development
@0x-jerry/x-release
Environment
{
  "local_name": "@0x-jerry/x-release",
  "alias": false,
  "peer_metadata": null
}
^0.4.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "8b1a815159c9aaf3b14addd3c359c9920a83b844",
  "tarball": "https://registry.npmjs.org/@0x-jerry/openapi-ts/-/openapi-ts-1.0.0.tgz",
  "fileCount": 6,
  "integrity": "sha512-GT9vnuScmUqQJmjVOsSTwdFshZFgZUgKPuVLfAeS2LCBNXHpzCwfynNfCYfJawQ6Aj15PejvqnvQJJUADb0fsw==",
  "signatures": [
    {
      "sig": "MEUCIFfusB5PgVtBZnYFaGPXfyoI+h7UXAUbFXUsb38taPTmAiEA+G1ITSWmAry25qfpsHe07pJvG0UdcPCgHrufUhQTsA4=",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "unpackedSize": 1101234
}

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:24cbf2ad1902c003b1705c3dd1ba2d05cd478c0c707f9f7dedb66f806e2f4e38

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 →