You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While urBackend supports unique field constraints (PR #52), there is no way for project owners to enforce data quality rules such as "email must match regex", "username must be 3-20 characters", or "age must be a positive integer". Invalid data enters the database freely, causing application bugs downstream and forcing client-side validation duplication across every SDK consumer.
Proposed Improvement
Add per-field validation rules in the collection schema designer that enforce constraints at the API level before any insert or update operation. The feature should:
Support validation types: minLength, maxLength, min, max, regex, enum, required
Validate on both POST /api/data/{collection} (insert) and PATCH /api/data/{collection}/{id} (update)
Return standardized 422 Unprocessable Entity with detailed field-level error messages
Show validation rules in the dashboard schema designer with live preview
Apply validation in both public-api and dashboard-api for consistency
Skip validation for sk_live requests if explicitly configured (admin override)
Expected Impact
Better data quality and integrity across all projects
Reduced client-side validation duplication in SDKs
Improved developer experience with clear validation errors
Better long-term scalability with pluggable validation engine
Possible Implementation
Add ValidationRule schema to packages/common/models/ with fields: type, value, message, fieldId
Extend Field model with validationRules array
Add validateDocument middleware in apps/public-api/middleware/ and apps/dashboard-api/middleware/
Problem
While urBackend supports unique field constraints (PR #52), there is no way for project owners to enforce data quality rules such as "email must match regex", "username must be 3-20 characters", or "age must be a positive integer". Invalid data enters the database freely, causing application bugs downstream and forcing client-side validation duplication across every SDK consumer.
Proposed Improvement
Add per-field validation rules in the collection schema designer that enforce constraints at the API level before any insert or update operation. The feature should:
minLength,maxLength,min,max,regex,enum,requiredPOST /api/data/{collection}(insert) andPATCH /api/data/{collection}/{id}(update)422 Unprocessable Entitywith detailed field-level error messagessk_liverequests if explicitly configured (admin override)Expected Impact
Possible Implementation
ValidationRuleschema topackages/common/models/with fields:type,value,message,fieldIdFieldmodel withvalidationRulesarrayvalidateDocumentmiddleware inapps/public-api/middleware/andapps/dashboard-api/middleware/uniqueconstraint flow (PR feat: add unique field constraints support with validation and model … #52) for unified validation pipelineGET /api/projects/{id}/collections/{name}/validationendpoint to fetch rulesI'm GSSoC'26 contributor, Please assign this task to me!