Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@japan-d2/schema-api-endpoint

japan-d212MIT0.10.1TypeScript support: included

API endpoint specification based on @japan-d2/schema

api

readme

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