Remove batch support declaration from block patterns REST, fix navigation areas#39834
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Followup to #39185 that removes batch support declaration from the block patterns and categories REST endpoints. They both support only
GET, and batching is relevant only for write methods likePOST.I'm also fixing batch support declaration for the
/wp/v2/block-navigation-areasendpoints (originally added by @anton-vlasenko in #36374). The/block-navigation-areasendpoint is only readable and doesn't need the declaration. But the/block-navigation-areas/{id}endpoint is writable and doesn't declare batch support. So I moved the declaration to the right place.How to test:
Before this patch, a batch request like:
would fail with a
rest_batch_not_allowederror. After this patch, it fails withrest_navigation_area_invalidwhich is better: the batch is performed, and it's the1id that's deemed invalid.