#38792 closed defect (bug) (fixed)
REST API: Clean up argument and property types
Reported by: | jnylen0 | Owned by: | joehoyle |
---|---|---|---|
Milestone: | 4.7 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | REST API | Keywords: | has-patch |
Focuses: | Cc: |
Description
Fixes a few remaining issues with argument and property types, found using this script to automatically check endpoint arguments and item schemas. (Current output of the script against trunk is here.)
- All args/properties should have a type and description
- All array args/properties should have an item type
- All
context
andcapabilities
properties should be consistently typed - A couple of checks specific to our object properties with
rendered
andraw
fields.
Follow-up to https://core.trac.wordpress.org/ticket/38531#comment:21.
Putting this in 4.7 because this is a good change for API consistency and because we currently allow some funky things like sending an array as the post password, so there are some minor BC implications here.
Attachments (1)
Change History (9)
#2
@
8 years ago
@jnylen0 @joehoyle I'm wondering: should we convert this script to a unit test? Seems like a good way to ensure future arguments/endpoints are registered with all the necessary pieces pretty nicely.
(We could get the index for wp/v2
instead of the root if we're concerned about stepping on other components'/plugin's toes.)
In 39250: