[wp-trac] [WordPress Trac] #39683: REST API JS Client: Should enable connecting to multiple endpoints at the same time

WordPress Trac noreply at wordpress.org
Tue Jan 24 22:52:00 UTC 2017


#39683: REST API JS Client: Should enable connecting to multiple endpoints at the
same time
----------------------------------------+----------------------------------
 Reporter:  adamsilverstein             |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  4.8
Component:  REST API                    |     Version:  4.7
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:  javascript, rest-
                                        |  api
----------------------------------------+----------------------------------
Changes (by adamsilverstein):

 * keywords:   => has-patch needs-unit-tests
 * milestone:  Awaiting Review => 4.8


Comment:

 [attachment:39683.diff]
 Correct a name collision issue that prevented the client from properly
 connecting to multiple APIs as it was designed to do.

 * Don't create default model for wp.api.endpoints - this should contain
 only initialized endpoints
 * Add some expected defaults for `versionString` and `apiRoot`
 * Add some missing quotes around properties when searching with
 `findWhere` as per coding standards
 * Fix bug: Clean up naming conventions so inner resolvedEndpoint doesn't
 overwrite outer endpoint
 * Fix: `deferred.resolve` call - only pass the resolvedEndpoint, not the
 wp.api global
 * Fix: url property should be a function that dynamically returns the
 current model route

 I'd like to add a QUnit test here to demonstrate/verify the fix by
 connecting to two known remote apis.

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


More information about the wp-trac mailing list