Catalog npm
Back to packageRELEASE DETAILS

0.1.1

npm

@0x-jerry/openapi-ts

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

Published19 Dec 2023
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
lodash-es
Environment
{
  "local_name": "lodash-es",
  "alias": false,
  "peer_metadata": null
}
^4.17.21runtime
quicktype-core
Environment
{
  "local_name": "quicktype-core",
  "alias": false,
  "peer_metadata": null
}
^23.0.80runtime
@0x-jerry/utils
Environment
{
  "local_name": "@0x-jerry/utils",
  "alias": false,
  "peer_metadata": null
}
^2.0.0runtime
swagger2openapi
Environment
{
  "local_name": "swagger2openapi",
  "alias": false,
  "peer_metadata": null
}
^7.0.8runtime
c8
Environment
{
  "local_name": "c8",
  "alias": false,
  "peer_metadata": null
}
^8.0.1development
tsx
Environment
{
  "local_name": "tsx",
  "alias": false,
  "peer_metadata": null
}
^4.6.2development
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.2development
vitest
Environment
{
  "local_name": "vitest",
  "alias": false,
  "peer_metadata": null
}
1.1.0development
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.10.5development
@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.3development
@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": "6152601fc0bac47102cae749e08b507d49c8064e",
  "tarball": "https://registry.npmjs.org/@0x-jerry/openapi-ts/-/openapi-ts-0.1.1.tgz",
  "fileCount": 7,
  "integrity": "sha512-Utol+Ipuz4D1sHp1pX6CoetIq9YCdAlWbXUYQA654C1gnml2BxqlM5KBH925sH2/ecEcj/QJw/cf+zen9Amq1g==",
  "signatures": [
    {
      "sig": "MEQCIAMJ63cPyc93v/Y968225Llr6YFbA3nImzWDFBkY0Hl2AiA7q9XpXuvt8S6jaYzXbOVL6FaCZu8/4YJatCvJllxEGQ==",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "unpackedSize": 312678
}

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:9caec00135e596b79a5d6312521a34fa4fe55a9de622011c0830df8571e5b6d6

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 →