1.0.1 • Published 4 years ago

carotte-schema-utils v1.0.1

Weekly downloads
201
License
ISC
Repository
github
Last release
4 years ago

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' }),
    },
  }),
};
1.0.1

4 years ago

1.0.0

4 years ago

0.2.2

4 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago