Overview
The Data Types catalog defines how to interpret and validate configuration values in the Invernaderos system. Each data type specifies validation rules, regex patterns, and display properties for settings configuration. Supported Types: INTEGER, LONG, DOUBLE, BOOLEAN, STRING, DATE, TIME, DATETIME, JSONGet All Data Types
Response
Array of data type objects
Get Active Data Types
isActive = true).
Response
Same structure as “Get All Data Types”, but filtered to active types only.Get Data Type by ID
Path Parameters
Data type ID
Response
Get Data Type by Name
Path Parameters
Data type name (case-insensitive, e.g., “INTEGER”, “BOOLEAN”)
Response
Same structure as “Get Data Type by ID”.Validate Value
Path Parameters
Data type ID
Query Parameters
Value to validate
Response
Validation Rules
Built-in Validation Rules
Built-in Validation Rules
| Data Type | Validation Logic | Examples |
|---|---|---|
| INTEGER | Must parse as 32-bit integer | 25, -100, 0 |
| LONG | Must parse as 64-bit integer | 1234567890, -999 |
| DOUBLE | Must parse as decimal number | 25.5, -10.75, 0.0 |
| BOOLEAN | Must be “true”, “false”, “1”, or “0” | true, false, 1, 0 |
| STRING | Any string is valid | "hello", "123", "" |
| DATE | Must parse as ISO-8601 date | 2025-03-15 |
| TIME | Must parse as ISO-8601 time | 14:30:00, 09:15:30 |
| DATETIME | Must parse as ISO-8601 datetime | 2025-03-15T14:30:00 |
| JSON | Must start with { or [ and end with } or ] | {"key": "value"}, [1, 2, 3] |
| Custom | Uses validationRegex if defined | Regex pattern dependent |
Create Data Type
Request Body
Type name (max 20 characters, will be converted to uppercase, must be unique)
Description of the data type
Regular expression for value validation (must be valid regex)
Example of a valid value
Sort order for UI display (minimum 0)
Whether the data type is active
Response
Update Data Type
Path Parameters
Data type ID to update
Request Body
All fields are optional. Only provided fields will be updated.New type name (max 20 characters, will be converted to uppercase)
New description
New validation regex (must be valid)
New example value
New display order (minimum 0)
New active status
Response
Delete Data Type
Path Parameters
Data type ID to delete
Response
Active/Inactive Filtering
Data types can be marked as inactive without deletion. This allows you to:- Soft delete deprecated types without losing historical data
- Hide unused types from UI dropdowns
- Preserve validation rules for existing configurations
Use Cases
- Filter Active Only
- Get All Types
- Deactivate Type
isActive = true.Use this for: Populating dropdowns in configuration UIs.Integration Examples
Error Codes
| Status Code | Description | Resolution |
|---|---|---|
| 200 OK | Request successful | - |
| 201 Created | Data type created successfully | - |
| 204 No Content | Data type deleted successfully | - |
| 400 Bad Request | Invalid input (duplicate name, invalid regex, validation error) | Check error message for details |
| 404 Not Found | Data type not found with specified ID or name | Verify the ID/name exists |
| 409 Conflict | Cannot delete system data type (IDs 1-9) | Use inactive status instead of deletion |
Best Practices
Custom Data Types
Custom Data Types
When creating custom data types:
- Use descriptive names (e.g.,
PERCENTAGE,PHONE_NUMBER,EMAIL) - Provide validation regex for strict input validation
- Include example values to guide users
- Set appropriate display order to group related types
Validation Performance
Validation Performance
- Cache active data types on client side to reduce API calls
- Validate on client first before sending to
/validateendpoint - Use regex validation for custom types to maintain consistency
- Batch validate multiple values if possible (client-side cache)
Soft Deletes vs Hard Deletes
Soft Deletes vs Hard Deletes
- Prefer soft deletes (
isActive = false) to preserve historical data - Only hard delete truly unused custom types
- Never delete system types (IDs 1-9 are protected)
- Document deprecation in the description field before deactivating