-
Notifications
You must be signed in to change notification settings - Fork 481
33695 task update pageapi to expose style properties #34155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
33695 task update pageapi to expose style properties #34155
Conversation
dotcms-postman/src/main/resources/postman/PagesResourceTests.json
Outdated
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/rest/api/v1/page/ResponseEntityContentletStylingView.java
Outdated
Show resolved
Hide resolved
dotcms-postman/src/main/resources/postman/PagesResourceTests.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t like that we have those unused fields such as error, i18nMessagesMap, messages, etc. However, I do think the entity should be respected and used to return the appropriate payload; at least in that regard our endpoints are consistent.
By sending items outside of the entity, we open the door to more inconsistency and disorder. I would remove 'ok' and send items inside the entity, and then document that change properly.
Proposed Changes
This request is to fix the scenario when defining
Style Propertiesfor an non-existingContentlet. A bad request exception should be returned.Files modified.
PagesResourceTest.json: Include Postman test for enriched response and BadRequest.AbstractContentletStylingView.java: Abstract class to define the fields in the viewContentletStylingViewused in the response of the Save Contentlet Request.ContentletStylingErrorEntity: Extension of the classErrorEntityto include more information about the error while saving. Omits null fields being send back to the response body.PageResource: Documentation added and return the new enriched response defined by the classResponseEntityContentletStylingView.PageResourceHelper: saveContent() method now return information about the Contentlet saved and calls 2 new methods:stylePropertiesValidation(): Validates (before saving) if the style properties belong to an existing Contentlet, otherwise throws a bad request exception.buildSaveContentResponse(): Builds the response with the Contentlet information to be returned when the request is successfully made, the information returned is defined by the classContentletStylingView.ResponseEntityContentletStylingView: new Response to be returned when saving Contentlets extends fromResponseEntityView.Enriched Successful Response
BadRequest when trying define style properties for non-existing Contentlet
This PR fixes: #33695
This PR fixes: #34092