Skip to content
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

Add 'method' as an expected link attribute #5

Merged
merged 1 commit into from
Dec 6, 2017

Conversation

chrissimon-au
Copy link
Contributor

Add 'method' as an expected link attribute. Appreciate this is non-standard, but works nicely with clients like Halon (https://github.com/LeanKit-Labs/halon#wait-what-are-you-doing-in-addition-to-hal)

There was some debate on the hal spec here about adding method as an optional attribute, which did determine not to add it to the spec... but if you don't mind adding it as a permitted attribute, it would certainly help our use case where we use multiple link relations for different operations on the same resource to explicitly signal which operation is permitted without requiring a separate OPTIONS request.

@naholyr
Copy link
Member

naholyr commented Dec 6, 2017

I honestly don't see the negative implications it could have, I'd tell : let's try and see if it bothers someone actually ;)
wondering if it should be considered a breaking change?

@naholyr naholyr merged commit 16c1e6d into byteclubfr:master Dec 6, 2017
@chrissimon-au
Copy link
Contributor Author

I think it shouldn't be a breaking change - the only case I can imagine is if someone was setting the method property on the link and relying on it not being included in the output - seems very unlikely!

@naholyr
Copy link
Member

naholyr commented Dec 7, 2017

👍 thanks for the input, gonna publish new minor version

@IanIsFluent
Copy link

Hi, I'm wondering how one should specify that there are multiple permitted methods - as the examples on https://github.com/LeanKit-Labs/halon#wait-what-are-you-doing-in-addition-to-hal all have a single method specified. I realise it's only allowed, so I can do what I like, but it seems strange to switch between a string and an array when there's 1 vs many methods:

"_links": {"self": {"href":"/x/y",method:"GET"}, "subresource": {"href":"/x/y/z",method:["GET","POST"]} }

I'm assuming you wouldn't split the subresource into two links, one for GET and one for POST?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants