100 строки
2.7 KiB
JSON
100 строки
2.7 KiB
JSON
{
|
|
"title": "JSON Schema for CLA assistant custom fields",
|
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
"type": "object",
|
|
"patternProperties": {
|
|
"^[A-Za-z0-9]*$": {
|
|
"type": "object",
|
|
"description": "Each property describes additional data which should be collected from a CLA signer and generates a form field",
|
|
"properties": {
|
|
"title": {
|
|
"type": "string",
|
|
"description": "Title is used to create a label for the form field"
|
|
},
|
|
"type": {
|
|
"oneOf": [{
|
|
"enum": ["hidden", "string", "textarea", "number", "boolean"],
|
|
"description": "Field of type boolean generates a checkbox"
|
|
},
|
|
{
|
|
"type": "object",
|
|
"description": "Field of type enum generates radio buttons",
|
|
"properties": {
|
|
"enum": {
|
|
"type": "array",
|
|
"minItems": 2,
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"uniqueItems": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"required": {
|
|
"type": "boolean",
|
|
"description": "Required fields are marked with asterisk and must be filled by signer"
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "Field description generates small text behind the label"
|
|
},
|
|
"maximum": {
|
|
"type": "number",
|
|
"description": "Can be used for fields of type number"
|
|
},
|
|
"minimum": {
|
|
"type": "number",
|
|
"description": "Can be used for fields of type number"
|
|
},
|
|
"githubKey": {
|
|
"type": "string",
|
|
"description": "Data of github user profile can be used to prefill the form. This refers to the response of the github api https://developer.github.com/v3/users/#get-a-single-user"
|
|
}
|
|
},
|
|
"anyOf": [{
|
|
"properties": {
|
|
"type": {
|
|
"enum": ["hidden"]
|
|
},
|
|
"required": {
|
|
"enum": [false]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"properties": {
|
|
"type": {
|
|
"enum": ["string", "textarea", "number", "boolean"]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"properties": {
|
|
"type": {
|
|
"type": "object",
|
|
"properties": {
|
|
"enum": {
|
|
"type": "array"
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"additionalProperties": false
|
|
}
|
|
},
|
|
"dependencies": {
|
|
"type": {
|
|
"properties": {
|
|
"required": {
|
|
"enum": [false]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
} |