-
Notifications
You must be signed in to change notification settings - Fork 480
Description
Description
Implement a REST API endpoint to support the insertion and updating of style properties for Contentlets. The API should provide a clean interface for managing styles while ensuring data consistency and validation against UVE schemas.
-
Create the REST endpoint at /v1/page/{pageId}/styles
Implement PUT endpoint for style properties management
Follow dotCMS REST API conventions
Ensure proper authentication and authorization -
Define and implement the request payload structure
Include MultiTree reference attributes:
child - Contentlet identifier
parent1 - Container identifier
parent2 - Page identifier
relation_type - Relationship type
personalization - Personalization identifier
variant_id - Variant identifierInclude the styles data object
Document payload structure with swagger -
Implement validation for style properties
Validate that styles are consistent with UVE schemas
Implement schema validation logic
Return appropriate error messages for validation failures -
Implement business logic for inserting/updating styles
Handle creation of new style entries
Handle updates to existing style entries
Ensure proper MultiTree reference handling
Implement transactional behavior -
Write comprehensive tests
Unit tests for validation logic
Integration tests for API endpoints
Test various payload scenarios (valid, invalid, edge cases)
Test UVE schema validation
Test authentication and authorization -
Hide this functionality under the feature flag
Ensure endpoint is only active when FEATURE_FLAG_UVE_STYLE_EDITOR feature flag is enabled
Return appropriate response when feature is disabled
4.7 Update API documentation
Acceptance Criteria
- REST endpoint /v1/page/{pageId}/styles is implemented and functional
- Payload correctly includes all MultiTree reference attributes and styles data
- Style validation against UVE schemas is working correctly
- All tests pass (unit and integration)
- Proper error handling and meaningful error messages are returned
Priority
None
Additional Context
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status