Opened 8 years ago
Closed 8 years ago
#39453 closed defect (bug) (wontfix)
WP REST API Response Media Type
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.4 |
Component: | REST API | Keywords: | |
Focuses: | rest-api | Cc: |
Description
The WP REST API responses in JSON format are sent using the media type application/json
.
However, the API documentation states that it complies to the HAL spec. The HAL spec defines a separate media type, which is identified as application/hal+json
.
So, if the WP REST API does indeed use the HAL media type as its response format, it should also use the corresponding identifier.
Note: I assume that it is too late at this point to change the response media type. However, the reasons for keeping the "incorrect" media type should be recorded in a ticket for posteriority.
Link to HAL spec: https://tools.ietf.org/html/draft-kelly-json-hal-07
Change History (3)
This ticket was mentioned in Slack in #core-restapi by kadamwhite. View the logs.
8 years ago
#3
@
8 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
- Version changed from 4.7 to 4.4
Also, application/json
is much more widely supported than application/hal+json
, and even if that weren't the case, as you noted, it is too late to change this. Therefore, closing as wontfix.
We do not fully conform to HAL, because of how our collections are structured; I think keeping application/json makes the most sense. The documentation in the REST API handbook has since been updated to clarify that our relations are inspired by HAL, statements that we conform have been removed.