@japan-d2/schema-api-endpoint
TypeScript icon, indicating that this package has built-in type declarations

0.10.1 • Public • Published

schema-api-endpoint

API endpoint specification based on @japan-d2/schema

install

npm install @japan-d2/schema-api-endpoint

or

yarn add @japan-d2/schema-api-endpoint

usage

const schema = endpointSchema({
  summary: 'test endpoint',
  description: 'this is test endpoint',
  request: {
    query: d => d.string('name'),
    body: d => d.string('data'),
    headers: d => d.string('authorization')
  },
  response: {
    body: d => d.string('data'),
    headers: d => d.string('cache-control')
  }
})

schema.request.toJSONSchema()
schema.response.toJSONSchema()

license

MIT

Readme

Keywords

Package Sidebar

Install

npm i @japan-d2/schema-api-endpoint

Weekly Downloads

0

Version

0.10.1

License

MIT

Unpacked Size

10.9 kB

Total Files

5

Last publish

Collaborators

  • uneco
  • tatat