octokit / octokit.objc

GitHub API client for Objective-C
MIT License
1.84k stars 319 forks source link

Hypermedia support #36

Closed jspahrsummers closed 5 years ago

jspahrsummers commented 11 years ago

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.

haacked commented 11 years ago

Does the GitHub API ever return URI Templates?

jspahrsummers commented 11 years ago

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.

haacked commented 11 years ago

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?

jspahrsummers commented 11 years ago

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.

jspahrsummers commented 11 years ago

@joshvera If/when you have time and are interested in prototyping this, can you assign this issue to yourself?

joshvera commented 11 years ago

:+1: