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
Property level validation for Management API #15644
Conversation
# Conflicts: # src/Umbraco.Cms.Api.Management/Controllers/Document/CreateDocumentController.cs # src/Umbraco.Cms.Api.Management/Controllers/Media/CreateMediaController.cs
# Conflicts: # src/Umbraco.Cms.Api.Management/Controllers/Document/CreateDocumentController.cs # src/Umbraco.Cms.Api.Management/Controllers/Document/UpdateDocumentController.cs
…encies, adds a lot of obsolete constructors
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.
Found a few small nitpicky things 😊
src/Umbraco.Cms.Api.Management/Controllers/Document/UpdateDocumentControllerBase.cs
Outdated
Show resolved
Hide resolved
src/Umbraco.Cms.Api.Management/Controllers/Media/CreateMediaController.cs
Outdated
Show resolved
Hide resolved
src/Umbraco.Cms.Api.Management/Controllers/Media/UpdateMediaControllerBase.cs
Outdated
Show resolved
Hide resolved
src/Umbraco.Core/PropertyEditors/Validation/JsonPathValidator.cs
Outdated
Show resolved
Hide resolved
src/Umbraco.Infrastructure/PropertyEditors/BlockEditorValidatorBase.cs
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.
Okay had a few more, just found out we could do this:
# Conflicts: # src/Umbraco.Cms.Api.Management/Content/ContentControllerBase.cs # src/Umbraco.Cms.Api.Management/Controllers/Document/CreateDocumentController.cs # src/Umbraco.Cms.Api.Management/Controllers/Media/CreateMediaController.cs # src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs
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.
LGTM 🚀
Prerequisites
Description
Adds support for property level validation in the management API for document and media editing operations. Any validation errors are returned in an
errors
collection of the resulting problem details, thus mimicking how ASP.NET Core handles request model validation errors.As content must always be saved despite property validation errors, the API cannot output the validation errors in the actual create and update responses:
201 Created
and a location header pointing to the newly created resource.200 OK
without a response body.To get around this, a new pair of "validation endpoints" have been introduced for create and update, respectively. These endpoints solely concerns themselves with property level validation.
The PR adds support for outputting an endpoint "operation status". This has been added for all document and media operations.
Testing this PR
Unstructured notes for test scenarios 😄
errors
for complex editor validation errors