WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#34303 closed task (blessed) (fixed)

Update the REST API header links

Reported by: johnbillion Owned by: rmccue
Milestone: 4.4 Priority: normal
Severity: normal Version: 4.4
Component: REST API Keywords: dev-feedback
Focuses: Cc:
PR Number:

Description

The link tag and Link header, produced by rest_output_link_wp_head() and rest_output_link_header() respectively, both include a rel attribute with a value of https://github.com/WP-API/WP-API.

Should these change? If so, what to?

Attachments (1)

34303.diff (699 bytes) - added by rmccue 4 years ago.
Change link relations to api.w.org

Download all attachments as: .zip

Change History (12)

#1 @johnbillion
4 years ago

rest_output_rsd() also refers to WP-API.

#2 @rmccue
4 years ago

  • Owner set to rmccue
  • Status changed from new to assigned

Good catch. These need to stay as URIs; they're kinda like XML namespaces in that they're just an unambiguous name. I've spoken to @nacin previously about this, and http://api.w.org/ was an option. It's nice and short, and it's currently unused. We could have it redirect to a devhub page too.

We'll need to use other stuff from this in the future too; custom relations are used in our links like http://v2.wp-api.org/term. I think http://api.w.org/v2/term would work nicely, and it's short.

WP-API in the RSD can be whatever we want. It's designed to allow conditional upgrading from existing XML-RPC clients, so "WordPress REST API" could work. ("REST API" could in theory clash with a future XML-RPC spec, if those are still being created.)

This ticket was mentioned in Slack in #core-restapi by rmccue. View the logs.


4 years ago

#4 @dd32
4 years ago

and http://api.w.org/ was an option. It's nice and short, and it's currently unused.

Although I'm not too fond of re-using subdomains where it's potentially ambiguous as to what resource we're using, that sounds viable to me.
The ambiguous issues come into play where today we shorten wordpress.org to w.org for resources, and I can see someone thinking api.w.org is short-hand for api.wordpress.org.

We'll need to use other stuff from this in the future too; custom relations are used in our links like http://v2.wp-api.org/term. I think http://api.w.org/v2/term would work nicely, and it's short.

This makes me think that using the short domain is worthwhile despite the shortcomings, and I feel the new url format there makes sense to use.

As a final mention, even though we're still talking about completely different domains..api.wordpress.org also matches the format of api.wordpress.org/$foo/$bar/$version/ which doesn't conflict with this.

@rmccue
4 years ago

Change link relations to api.w.org

#5 @rmccue
4 years ago

Patch attached to change the links; we'll also need to update link relations in the endpoints.

@danielbachhuber @joehoyle Are both of you +1 on this? (No emoji on Trac makes Ryan sad.)

#6 @rachelbaker
4 years ago

@rmccue Even though you didn't ask me, I am +1 on api.w.org

#7 @danielbachhuber
4 years ago

Seems reasonable to me.

#8 @joehoyle
4 years ago

:thumbsup: from me

This ticket was mentioned in Slack in #core-restapi by joehoyle. View the logs.


4 years ago

#10 @nacin
4 years ago

I'm good with this as long as @dd32 is good with this.

#11 @rmccue
4 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 35650:

REST API: Change link relations to api.w.org

Fixes #34303.

Note: See TracTickets for help on using tickets.