Add data type
Adds a data type.
The role performing this operation must have the CapTypesWriter
capability.
See Access control for more information about how
capabilities are used to control access to operations.
Request
Request body
Details of the data type, including the names and locations of the JavaScript functions it uses.
- application/json
The data type and its function. default_transformer is the default transformer for the data type and should be taken from the transformers list.
name
- string required*The name of a data type.
is_builtin
- booleanWhether this data type is built-in or user defined.
base_type_name
- string required*The name of a data type.
description
- stringThe description of a model.
validator
- stringThe bundle and function name formatted as
<bundle-name>.<function-name>
.normalizer
- stringThe bundle and function name formatted as
<bundle-name>.<function-name>
.transformers
- array of stringsThe names of transformers that are supported for the data type.
Each string:The bundle and function name formatted as
<bundle-name>.<function-name>
.default_transformer
- stringThe bundle and function name formatted as
<bundle-name>.<function-name>
.
{
"name": "student_id",
"base_type_name": "STRING",
"description": "A custom data type representing a student ID based on the built-in STRING type.",
"validator": "example_bundle.validate_student_id",
"normalizer": "example_bundle.normalize_student_id",
"transformers": [
"example_bundle.format_student_id",
"example_bundle.mask_first_4_digits"
],
"default_transformer": "example_bundle.format_student_id"
}
Possible responses
- 200
- 400
- 401
- 403
- 404
- 405
- 409
- 410
- 500
- 503
The request is successful.
- application/json
The data type and its function. default_transformer is the default transformer for the data type and should be taken from the transformers list.
name
- string required*The name of a data type.
is_builtin
- booleanWhether this data type is built-in or user defined.
base_type_name
- string required*The name of a data type.
description
- stringThe description of a model.
validator
- stringThe bundle and function name formatted as
<bundle-name>.<function-name>
.normalizer
- stringThe bundle and function name formatted as
<bundle-name>.<function-name>
.transformers
- array of stringsThe names of transformers that are supported for the data type.
Each string:The bundle and function name formatted as
<bundle-name>.<function-name>
.default_transformer
- stringThe bundle and function name formatted as
<bundle-name>.<function-name>
.creation_time
- stringThe time when the data type was created.
{
"name": "student_id",
"base_type_name": "STRING",
"description": "A custom data type representing a student ID based on the built-in STRING type.",
"validator": "example_bundle.validate_student_id",
"normalizer": "example_bundle.normalize_student_id",
"transformers": [
"example_bundle.format_student_id",
"example_bundle.mask_first_4_digits"
],
"default_transformer": "example_bundle.format_student_id",
"creation_time": "2022-12-01T10:04:42.777225Z"
}
The request is invalid.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1001",
"message": "The access reason is missing.",
"context": {
"reason": null
}
}
Authentication credentials are incorrect or missing.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1005",
"message": "The request is unauthorized.",
"context": {}
}
The caller doesn't have the required access rights.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1007",
"message": "The operation is forbidden due to missing capabilities.",
"context": {
"username": "WebServer"
}
}
Reserved for future use.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1004",
"message": "The data type is not found.",
"context": {}
}
The operation is not allowed.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1026",
"message": "The operation is not allowed in in-memory mode.",
"context": {}
}
A conflict occurs.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV3218",
"message": "Concurrent conflicting updates to the same object.",
"context": {}
}
Access to a resource that is no longer available occurs.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1033",
"message": "The resource is gone.",
"context": {}
}
An error occurs on the server.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1000",
"message": "Something went wrong",
"context": {}
}
The service is unavailable.
- application/json
context
- object required*The error context.
Values of additional properties are stringsExample{
"objectid": "b56dd6aa-35f0-11ed-a261-0242ac120002"
}error_code
- string required*The error code.
message
- string required*The error message.
error_url
- stringThe URL to the error documentation.
{
"error_code": "PV1009",
"message": "The operation timed out on the server.",
"context": {}
}
Request body
Code examples