Closed matiasbenedetto closed 9 months ago
Note that I've outlined a proposed API design used for this refactoring effort in https://github.com/WordPress/gutenberg/issues/57616
Can this be closed now that https://github.com/WordPress/gutenberg/pull/57688 is merged?
Yep, let's close it and work over more granular issues.
What?
Font Library: refactor REST API endpoints.
Refactor REST endpoint URLs
(reference reference). PR:
Transition the Font Family APIs to be SINGULAR
(accepting as parameters and returning as responses a single Font Family item) (reference reference )
PR:
Return a single Error (with multiple calls to
add()
)instead of a collection of errors. (reference reference )
Return API responses with
rest_ensure_response
instead ofnew WP_REST_Response()
(reference)
Ensure there is error handling of any decoded JSON string
( reference )
Add schema's to the requests
(reference)
Break the font library REST API controller in 2 controllers.
One for font families and one for font collections. (reference)
PR:
Error code strings need to be translated
([reference]).
Ensure the gutenberg domain used for translations is removed when porting to core.
(reference)
Why?
To standardize the endpoint routes and input/output data formats and schemas.
How?
This task is somewhat big, so multiple PRs for it are expected.
Props to all the folks that brought this issue in this PR: https://github.com/WordPress/wordpress-develop/pull/5285