[wp-trac] [WordPress Trac] #34207: Leverage the REST API structure for the oEmbed endpoint

WordPress Trac noreply at wordpress.org
Mon Oct 12 23:33:21 UTC 2015


#34207: Leverage the REST API structure for the oEmbed endpoint
--------------------------------------+-------------------------
 Reporter:  swissspidy                |       Owner:  swissspidy
     Type:  enhancement               |      Status:  assigned
 Priority:  normal                    |   Milestone:  4.4
Component:  Embeds                    |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-------------------------

Comment (by danielbachhuber):

 tl;dr: you shouldn't include the JSON schema code in this patch.

 Here are my notes on the JSON schema conversation:

 **Q: What is the purpose of defining the resource with a schema?**

 * To have the format of the object documented in a structured manner.
 Because it's documented in a structured manner, we can automagically
 create human-readable documentation from it.
 * Closely-coupling structured documentation to the code will help prevent
 it from getting out of date.
 * We can also use the schema internally to programmatically manipulate the
 request or response (e.g. validate required parameters, filter response
 based on context)

 **Q: Why JSON schema?**

 * It is quite graybeard. JSON schema has been around for a long time, and
 is a well-known standard.
 * We can extend JSON schema base spec to include our own attributes, and
 publish this extension.
 * There aren't any competing standards that are better.

 **Q: What needs to be done to finalize our implementation for 4.4?**

 * Most pieces related to our schema implementation shouldn't be committed
 to core for 4.4.
 * However, we have support for `schema` in the registration, but the
 implementation takes an arbitrary array/object and spits it out on OPTIONS
 requests. There's no need to remove it at this time.

 **Q: What might be done later?**

 * Document and publish the ways in which our schema differs from JSON
 schema draft 4
 * Probably lots of other little things.

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


More information about the wp-trac mailing list