apischema

api schema

Usage no npm install needed!

<script type="module">
  import apischema from 'https://cdn.skypack.dev/apischema';
</script>

README

apischema

Useage

export const getCategorys = schema.get('/api/getcategorys/{page}', {
  page: { type: Number, required: true, urlOnly: true },
  type: { type: Number, required: true },
});

getCategorys({
  page: 1,
  type: 1
}, {
  headers: {
    'X-Access-Token': 'djdjxjqi111',
  },
}).then((json) => {
  log(json);  
});

Dev

$ npm i
$ npm test
$ npm run dist