[wp-trac] [WordPress Trac] #37182: Collections are not compatible to HAL standard

WordPress Trac noreply at wordpress.org
Wed Nov 2 06:41:20 UTC 2016


#37182: Collections are not compatible to HAL standard
--------------------------+-----------------------
 Reporter:  maennchen     |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:
Component:  REST API      |     Version:  4.4
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+-----------------------
Changes (by maennchen):

 * status:  closed => reopened
 * resolution:  wontfix =>


Comment:

 == Ergonomics

 That's exactly where I can't agree with you. An API is made to be consumed
 by a machine and not a user. If you want to write something, thats
 aesthetic to the eye, you should've gone with something like JSON-LD.

 The ergonomics are far worse than if you were using the standard, because
 this way all libraries can't process the API.

 The HAL standard is highly standardised, which allows generic clients to
 interact with any API. If you are not in fact planning to be HAL
 compliant, please do not label it as HAL compliant. (Which is sad, because
 HAL would've been a great choice to use.)

 == Documentation mentioning HAL

 http://v2.wp-api.org/extending/linking/

   The linking system we use is based on HAL (Hypertext Application
 Language).

 No, it is not based on the HAL standard, it may look similar, but it is
 not.

 http://v2.wp-api.org/changes-beta-1.html

   Changed: Hypermedia links have changed from meta.links to _links to
 follow the HAL standard. In custom endpoints, you can either return _links
 in your data, or use WP_REST_Response->add_link

 No, it does not follow the HAL standard, it may look similar, but it is
 not.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37182#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list