Create a new annotation schema
POST /annotation-schemas/v1
-
Headers:
X-ANNOTATIONSCHEMAS-APPKEY
(string): Required. The API key to authenticate the request.
-
Request Body:
{ "name": "string (nullable)", "description": "string (nullable)", "specification": "string (nullable) - stringified json specification (see the Notes bellow)" }
Example:
{ "name": "citizen-card", "description": "Citizen Card - personal identification card used in many countries.", "specification": "{\"$schema\": \"http://json-schema.org/draft-07/schema#\",\"title\": \"Citizen Card\",\"type\": \"object\",\"properties\": {\"date_of_birth\": {\"type\": \"string\"},\"document_number\": {\"type\": \"string\"},\"expiry_date\": {\"type\": \"string\"},\"names\": {\"type\": \"string\"},\"surnames\": {\"type\": \"string\"},\"nationality\": {\"type\": \"string\"},\"taxid\": {\"type\": \"string\"},\"socialsecurityid\": {\"type\": \"string\"},\"healthsystemid\": {\"type\": \"string\"},\"mrz\": {\"type\": \"string\"}},\"required\": [\"date_of_birth\",\"document_number\",\"expiry_date\",\"names\",\"surnames\",\"nationality\",\"taxid\",\"socialsecurityid\",\"healthsystemid\",\"mrz\"],\"additionalProperties\": false}" }
-
Responses:
200 OK
: Returns the created schema.400 Bad Request
: If the input is invalid.
NOTES to create your json specification:
additionalProperties: false
must always be set in objects
additionalProperties controls whether it is allowable for an object to contain additional keys / values that were not defined in the JSON Schema.
Example:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Citizen Card",
"type": "object",
"properties": {
"date_of_birth": {
"type": "string"
},
"document_number": {
"type": "string"
},
"expiry_date": {
"type": "string"
},
"names": {
"type": "string"
},
"surnames": {
"type": "string"
},
"nationality": {
"type": "string"
},
"taxid": {
"type": "string"
},
"socialsecurityid": {
"type": "string"
},
"healthsystemid": {
"type": "string"
},
"mrz": {
"type": "string"
}
},
"required": [
"date_of_birth",
"document_number",
"expiry_date",
"names",
"surnames",
"nationality",
"taxid",
"socialsecurityid",
"healthsystemid",
"mrz"
],
"additionalProperties": false
}