Catalog npm
Back to packageRELEASE DETAILS

1.0.1

npm

@0x-jerry/openapi-ts

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

Published10 Feb 2024
Direct dependencies16
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 16

Native requirements
16 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
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
@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

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "9b02b8d588ee02eb6d23db44046b85559a878bd2",
  "tarball": "https://registry.npmjs.org/@0x-jerry/openapi-ts/-/openapi-ts-1.0.1.tgz",
  "fileCount": 4,
  "integrity": "sha512-auntLF9q/DE2Z+VZiVs/pAsmURBleG7xwNecQZVL/efb6RwTltwEV+2oTW2Wz67y4kz56x1/RBaPBBt+F09yoQ==",
  "signatures": [
    {
      "sig": "MEUCIQD4N7V1/3JMIL4O/ZsgwJ78gyvNJkuEpRwe2mPUl3uoGwIgDindnqm9rLb8M0cCVA3EAgF32eAqj/DrReurpuyAdzE=",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "unpackedSize": 17341
}

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:cf14a7c20bdeb1dba3a7d0b5b6ea06e5147f2633c4e7281a8a8d12eb1fd99f6a

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 →