Closed jspahrsummers closed 5 years ago
Does the GitHub API ever return URI Templates?
Not currently, but the reference to RFC 6570 implies that it might in the future. @joshvera points out that it's probably a ways off, but we should get ready.
I imagine this would help paging scenarios. You could then use the URI Template to construct a URL for a specific page rather than having to follow each request from page to page. Is that the key benefit? Not embedding URI templates in the client app, but being able to construct them?
Something like that. It also allows resources to be embedded or hyperlinked from other resources at the API designer's discretion.
For instance, if a hyperlinked resource is pretty much always requested, embedding it could reduce server load (by eliminating an unnecessary request). Conversely, if an embedded resource is not actually that useful, hyperlinking it instead could improve the performance of the base request.
@joshvera If/when you have time and are interested in prototyping this, can you assign this issue to yourself?
:+1:
Right now, OctoKit walks all hypermedia links manually, and expects them to be fully-constructed URLs (instead of URI templates). We should build in real hypermedia support using HAL.