How to use the koa-joi-router.Joi.boolean function in koa-joi-router

To help you get started, we’ve selected a few koa-joi-router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github a-s-o / koa-docs / example / routes / store.js View on Github external
'use strict';

const t = require('koa-joi-router').Joi;

const Order = t.object().label('Order').keys({
   id: t.number(),
   petId: t.number(),
   quantity: t.number(),
   shipDate: t.date(),
   status: t.string().valid(['placed', 'approved', 'delivered']),
   complete: t.boolean()
});

const Quantity = t.number().integer().label('Quantity');

const storeInventory = {
   method: 'get',
   path: '/inventory',
   meta: {
      friendlyName: 'Store inventory',
      description: 'Returns pet inventories by status',
      extendedDescription: `
         **Implementation notes**
         * Returns a map of status codes to quantities
      `
   },
   validate: {

koa-joi-router

Configurable, input validated routing for koa.

MIT
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis