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.
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've checked some stable endpoints in the gutenberg and wordpress-develop codebase and this is what I see:
wp/v2/pattern-directory
,wp/v2/widget-types
,wp/v2/widgets
,wp/v2/block-directory
,wp/v2/block-types
,wp/v2/comments
.Following the convention of existing endpoints, I wonder if this should be
wp/v2/block-editor-settings
instead,wp/v2
as namespace andblock-editor-settings
asrest_base
.I'd welcome thoughts from people more experienced with the REST API naming schema, cc @TimothyBJacobs
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.
Thanks for the suggestions @nosolosw!
From this comment it was suggested to use this naming instead of following the
wp/v2/
convention, although it'd make things easier if it was using the same structure as the existing ones 😅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.
Yeah the intention to use the different namespace is that
wp/v2
is for modeling data, whereas this is purely a block editor API returning configuration values.There really is no plan to introduce a
wp/v3
for numerous reasons, but putting this in a block editor namespace would allow for more freedom in introducing newer versions for breaking changes.This would match what we did for Site Health in having a
wp-site-health/v1
namespace. I think the only inconsistency here would be that ideally theblock-directory
andpattern-directory
endpoints would've been part of this namespace as well.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 see, thanks for the context. Let's do this then.
As a data point for the future, I'd like to provide the thought that it's difficult to reason about why/when something is data or a setting from the perspective of a consumer of the API. By looking at the reference documentation, I see endpoints that are arguably config: post types, block types, site settings to name a few.
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.
Sounds good! Let's keep the
wp-site-health/v1
namespace 👍Can we then proceed with removing the
__experimental
part? Thanks!