carotte-schema-utils
v1.0.1
Published
AJV types for Carotte meta
Downloads
4
Readme
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' }),
},
}),
};