zalando / restful-api-guidelines

A model set of guidelines for RESTful APIs and Events, created by Zalando
https://opensource.zalando.com/restful-api-guidelines/
Creative Commons Attribution 4.0 International
2.62k stars 384 forks source link

Improve embedding of resources guideline. #483

Open tkrop opened 5 years ago

tkrop commented 5 years ago

Our HAL-based rule Should: Allow Optional Embedding of Sub-Resources predates our new Must: Use Common Hypertext Controls guideline and may not fit perfectly in this new world.

I'm wondering whether the we could find a better guidance here.

ePaul commented 5 years ago

@tkrop will talk to @meshcalero about this.

ePaul commented 5 years ago

@meshcalero will try to do a minimally-invasive PR for this.

tfrauenstein commented 4 years ago

@meshcalero Hi Andreas, you recently said that you 'try to do a minimally-invasive PR for this' which would be great. Do you still have it on your to-do list? Thx.

ePaul commented 4 years ago

Idea: remove the _embedded field, instead use the embed parameter to expand a "common hypertext control" to a full object.

I'll try to figure out how to write this in a rule.

whiskeysierra commented 4 years ago

Isn't _embedded part of the response while the embed parameter is part of the request? How should one substitute one with the other?

ePaul commented 3 years ago

example API using this (internal link).

ePaul commented 8 months ago

Reminder to me: Please finally do it!