Opened 8 months ago
Last modified 5 weeks ago
#61911 new defect (bug)
Incorrect schema for global styles REST API endpoint
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 6.9 | Priority: | normal |
Severity: | normal | Version: | 5.9 |
Component: | Posts, Post Types | Keywords: | has-patch has-unit-tests |
Focuses: | rest-api | Cc: |
Description
The schema for the wp/v2/global-styles/{id}
REST API endpoint declares the id
property as a string, but it is in fact an integer containing the post ID for the global style.
Change History (15)
This ticket was mentioned in PR #7234 on WordPress/wordpress-develop by @narenin.
8 months ago
#1
- Keywords has-patch added; needs-patch removed
@johnbillion commented on PR #7234:
8 months ago
#2
@narenin Thanks for the PR. int
isn't a valid type in JSON schema.
8 months ago
#3
@johnbillion Thanks for the review, I have updated the same to integer
, please check.
@TimothyBlynJacobs commented on PR #7234:
7 months ago
#4
This is slightly weird because the value does have a sanitize_callback
registered for it which calls urldecode
, which seems like an indication that the value is supposed to be a string. Are we sure this is supposed to be an integer
? If so, we should probably also be removing the sanitize_callback
.
narendraie commented on PR #7234:
7 months ago
#5
Thanks @johnbillion @TimothyBJacobs for your feedback's, I have implemented the same, could you please take a look.
7 months ago
#6
Thanks @johnbillion @TimothyBJacobs for your feedback's, I have implemented the same, could you please take a look.
narendraie commented on PR #7234:
7 months ago
#7
Thanks @johnbillion @TimothyBJacobs for your feedback's, I have implemented the same, could you please take a look.
#8
@
7 months ago
- Keywords good-first-bug removed
- Milestone changed from 6.7 to 6.8
This is close but there are some failing tests in the associated PR that need to be investigated.
#9
@
6 months ago
@johnbillion The regular expression for the id
parameter can be simplified. The pattern (?P<id>[\/\d+]+)
implies that the id
can contain slashes, which is unusual for an integer ID. It would be more appropriate to use (?P<id>\d+)
to match only digits.
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
3 months ago
@audrasjb commented on PR #7234:
3 months ago
#11
@johnbillion @TimothyBJacobs are you available to review the edited PR? Thanks!
@johnbillion commented on PR #7234:
2 months ago
#12
@narenin Want to take a look at these failing unit tests?
This ticket was mentioned in PR #8585 on WordPress/wordpress-develop by @abcd95.
5 weeks ago
#14
- Keywords has-unit-tests added; needs-unit-tests removed
Trac ticket: https://core.trac.wordpress.org/ticket/61911