Skip to content

Commit

Permalink
update FieldMetaSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
rnegron committed Nov 20, 2024
1 parent 7b36db5 commit 79d3b18
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
7 changes: 6 additions & 1 deletion packages/schema/docs/build/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -934,13 +934,18 @@ Yes | Yes | Array of [FieldChoiceWithLabel](#fieldchoicewithlabelschema)

## /FieldMetaSchema

Allows for additional metadata to be stored on the field. Only string, numeric or boolean values are allowed
Allows for additional metadata to be stored on the field.

#### Details

* **Type** - `object`
* [**Source Code**](https://github.com/zapier/zapier-platform/blob/[email protected]/packages/schema/lib/schemas/FieldMetaSchema.js)

#### Properties

Key | Required | Type | Description
--- | -------- | ---- | -----------
`[^\s]+` | no | anyOf(`string`, `integer`, `boolean`) | Only string, integer or boolean values are allowed.

#### Examples

Expand Down
19 changes: 16 additions & 3 deletions packages/schema/exported-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,22 @@
"FieldMetaSchema": {
"id": "/FieldMetaSchema",
"type": "object",
"description": "Allows for additional metadata to be stored on the field. Only string, numeric or boolean values are allowed",
"additionalProperties": {
"type": ["string", "number", "boolean"]
"description": "Allows for additional metadata to be stored on the field.",
"patternProperties": {
"[^\\s]+": {
"description": "Only string, integer or boolean values are allowed.",
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "boolean"
}
]
}
}
},
"FieldSchema": {
Expand Down
10 changes: 6 additions & 4 deletions packages/schema/lib/schemas/FieldMetaSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ const makeSchema = require('../utils/makeSchema');
module.exports = makeSchema({
id: '/FieldMetaSchema',
type: 'object',
description:
'Allows for additional metadata to be stored on the field. Only string, numeric or boolean values are allowed',
additionalProperties: {
type: ['string', 'number', 'boolean'],
description: 'Allows for additional metadata to be stored on the field.',
patternProperties: {
'[^\\s]+': {
description: 'Only string, integer or boolean values are allowed.',
anyOf: [{ type: 'string' }, { type: 'integer' }, { type: 'boolean' }],
},
},
examples: [
{ shouldCapitalize: true },
Expand Down

0 comments on commit 79d3b18

Please sign in to comment.