master-zapier-plan-draft/vendor/zapier-platform/packages/schema/lib/schemas/FieldChoicesSchema.js
George Lambert b4150c8250 Milestone 0: import zappier billing, Verae middleware, and Zapier research
Compose-ready workspace: packages/zappier (rate card, portal, Stripe),
packages/verae-zapier-middleware (timestamp + NATS), packages/verae-zapier
(CLI app), vendor/zapier-platform, and research/zapier vendor corpus.

Gate 0 structure checks pass. Product code and research are not yet wired.
2026-09-09 02:37:36 -04:00

41 lines
1.2 KiB
JavaScript

'use strict';
const makeSchema = require('../utils/makeSchema');
const FieldChoiceWithLabelSchema = require('./FieldChoiceWithLabelSchema');
module.exports = makeSchema(
{
id: '/FieldChoicesSchema',
description:
'A static dropdown of options. Which you use depends on your order and label requirements:\n\nNeed a Label? | Does Order Matter? | Type to Use\n---|---|---\nYes | No | Object of value -> label\nNo | Yes | Array of Strings\nYes | Yes | Array of [FieldChoiceWithLabel](#fieldchoicewithlabelschema)',
oneOf: [
{
type: 'object',
minProperties: 1,
not: { required: ['perform'] },
},
{
type: 'array',
minItems: 1,
items: {
oneOf: [{ type: 'string' }, { $ref: FieldChoiceWithLabelSchema.id }],
},
},
],
examples: [{ a: '1', b: '2', c: '3' }, ['first', 'second', 'third']],
antiExamples: [
{
example: [1, 2, 3],
reason:
'If an array, must be of either type string or FieldChoiceWithLabelSchema',
},
{
example: [{ a: '1', b: '2', c: '3' }],
reason:
'If an array, must be of either type string or FieldChoiceWithLabelSchema',
},
],
},
[FieldChoiceWithLabelSchema],
);