carotte-schema-utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

carotte-schema-utils

Installation

yarn add carotte-schema-utils

Usage

Wherever the metas are used:

import schemaUtils from 'carotte-schema-utils';
 
export default {
  description: 'My Carotte function',
  permissions: ['resource.verb'],
  requestSchema: schemaUtils.object({
    required: ['query'],
    query: schemaUtils.object({
      required: ['filters'],
      properties: {
        filters: schemaUtils.object({
          required: ['id'],
          properties: {
            id: schemaUtils.uuidsv4({ description: 'Ids of Products' }),
          },
        }),
      },
    }),
  }),
  responseSchema: schemaUtils.object({
    properties: {
      updated: schemaUtils.integer({ description: 'Number of rows updated' }),
    },
  }),
};

/carotte-schema-utils/

    Package Sidebar

    Install

    npm i carotte-schema-utils

    Weekly Downloads

    192

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    3.8 kB

    Total Files

    8

    Last publish

    Collaborators

    • cubyn
    • fpierre