-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HAL support #2
HAL support #2
Conversation
👍 |
Added support for reflecting hypermedia based on the fields (Url, RepositoryUrl, etc). Most of them will need to use the "rel" annotation so it uses a value consistent with HAL. As far as the GitHub API goes, we should rely on the reflected hypermedia behavior. Full HAL support would come through a specific media type like "application/vnd.github.hal+json". Instead of passing the structs around as |
rels map[string]Hyperlink | ||
} | ||
|
||
func (r *ReflectHypermediaResource) Rels() map[string]Hyperlink { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you planning to move the parsing logic to a decoder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need two decoders in the end: json decoder and hyperresource decoder to fill up a HyperResource
Okay, this is much easier. I don't care for the names though. Kind of thinking:
It could go into a separate hypermedia package too.
|
👍 It tastes good. The APIs for this portion start to become elegant! |
I think I'm going to keep the hypermedia stuff in the sawyer package. The names are longer, but you won't have to import two things every time you use sawyer. What do you think? |
I think it makes perfect sense to keep it within the same package for now |
Cool. Merging this. I don't consider this repo "published" yet, so we can still change names. The README still says "Very experimental", and there aren't really any go docs yet. I'd actually like to successfully integrate this into a couple clients to see how it feels. |
…permediaResource arg.
Just a quick idea on how we might handle hypermedia parsing. The GitHub API structs would want to extend HALResource into something that checks HAL first, and then
*Url
properties second.