diff --git a/schemas/api-config/field.json b/schemas/api-config/field.json index 359cc5f..8f30af2 100644 --- a/schemas/api-config/field.json +++ b/schemas/api-config/field.json @@ -85,34 +85,68 @@ ] }, "choices": { - "type": "array", - "description": "choices to select from", - "items": { - "type": "object", - "properties": { - "id": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "string" - }, - { - "type": "number" + "oneOf": [ + { + "type": "object", + "description": "endpoint configuration", + "additionalProperties": false, + "properties": { + "endpoint": { + "type": "string", + "description": "endpoint URL or path" + }, + "params": { + "type": "object", + "description": "query parameters" + }, + "mapping": { + "type": "object", + "description": "data mapping", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "description": "name of id field" + }, + "name": { + "type": "string", + "description": "name of name/description field" + } } - ] - }, - "name": { - "description": "name is human readable value", - "$ref": "#/definitions/i18nString" - }, - "chipStyle": { - "$ref": "https://raw.githubusercontent.com/rcorp/css-schema/master/schema.json" + } } }, - "required": ["id", "name"] - } + { + "type": "array", + "description": "choices to select from", + "items": { + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "name": { + "description": "name is human readable value", + "$ref": "#/definitions/i18nString" + }, + "chipStyle": { + "$ref": "https://raw.githubusercontent.com/rcorp/css-schema/master/schema.json" + } + }, + "required": ["id", "name"] + } + } + ] }, "valueMap": { "type": "object",