Skip to main content

Expression Library API

Built-in and custom expression templates used in pipeline operator logic stages. Custom expressions are tenant-scoped.

FieldValue
Port50033
Base Path/api/v1
FrameworkSpring Boot 3.2.0, Java 21
OpenAPI3.0.1
SpecExpression_LIbrary.json
Swagger UI/swagger-ui.html
DatabasePostgreSQL (daitics)

Authentication

ConfigValue
MethodOAuth2 JWT (Keycloak)
Multi-tenancytenant_id from JWT — custom expressions scoped per tenant
CORSlocalhost:3000, localhost:8080, *.daitics.com
Public endpoints/actuator/health, /actuator/info, /v3/api-docs/**, /swagger-ui/**

System Expressions (Read-Only)

Built-in expressions available to all tenants.

MethodPathDescriptionQuery Params
GET/api/v1/expressionsList system expressionscategory, operatorType, search, tags[]
GET/api/v1/expressions/{id}Get by integer ID
GET/api/v1/expressions/by-expression-id/{expressionId}Get by string ID (e.g., CONCAT)

ExpressionDTO

{
"id": 1,
"expressionId": "CONCAT",
"name": "CONCAT",
"category": "STRING",
"operatorTypes": ["TRANSFORM", "FILTER"],
"description": "Concatenates multiple strings...",
"syntax": "CONCAT(str1, str2, ...strN, separator)",
"example": "CONCAT(firstName, \" \", lastName) -> \"John Doe\"",
"parameters": [ ... ],
"returnType": "STRING",
"tags": ["string", "text", "concatenation"],
"isActive": true
}

Custom Expressions (Tenant-Scoped CRUD)

MethodPathDescriptionStatus Codes
GET/api/v1/expressions/customList tenant's custom expressions200
POST/api/v1/expressions/customCreate custom expression201, 400, 409
GET/api/v1/expressions/custom/{id}Get by UUID200, 404
PUT/api/v1/expressions/custom/{id}Update (version increments on body change)200, 400, 404, 409
DELETE/api/v1/expressions/custom/{id}Soft delete204, 404
POST/api/v1/expressions/custom/{id}/useIncrement usage count200

CreateCustomExpressionRequest

FieldTypeRequiredValidation
expressionIdstringYes3–100 chars, ^[a-z0-9_]+$
namestringYes3–100 chars, starts with letter
descriptionstringNoMax 1000 chars
categorystringYesMax 50 chars
operatorTypesstring[]No
parametersobject (JSONB)Yes
bodystringYes1–5000 chars
returnTypestringYesSee return types below
tagsstring[]No
isTemplatebooleanNoDefault false

Return Types: STRING INTEGER DECIMAL BOOLEAN DATE TIMESTAMP ARRAY JSON ANY


Response Envelope

{
"success": true,
"data": { ... },
"error": {
"code": "string",
"message": "string",
"details": { ... }
},
"timestamp": "2025-11-11T10:30:00"
}

Error Codes

CodeHTTPMeaning
RESOURCE_NOT_FOUND404Expression not found
VALIDATION_ERROR400Input validation failed
DATA_INTEGRITY_VIOLATION409Duplicate expression_id
INTERNAL_SERVER_ERROR500Unexpected error

Database Tables

TableKeyScopeIndexes
expressions_libraryid (SERIAL), unique expression_idSystem-wide11 (B-tree + GIN for arrays/JSONB/FTS)
custom_expressionsid (UUID)Per-tenant (tenant_id)11 (B-tree + GIN)

Health & Actuator

PathAuthDescription
/actuator/healthPublicDB, disk, liveness, readiness
/actuator/infoPublicService info
/actuator/metricsAuth requiredPrometheus-style metrics

Frontend Integration

FilePurpose
services/expression-library/expression-library.service.tsExpression fetching & evaluation
services/expression-library/useExpressions.tsReact Query hook
types/expression-library-api.types.tsTypeScript types