kevinswiber/siren

Understanding the format: How to include addition info in collection response

pke opened this issue · 1 comments

pke commented

Being new to siren I am struggling with the following scenario.
I have a collection resource that returns a different result based on a query param:
/items?code=FOOBAR

What would be the responses class and properties?

The response would contain the items but I'd like it to also include information about the code, especially when it is about to expire. Would the _links key the right place to put a rel: ["code"] in there that references the code resource where the client could get more info about the code? Could the collection response also already contain parts of the code resource, like the expireDate as inline properties?

Could the expireDate be part of the responses properties?

Thanks for helping out here.

Have you seen issue #54 ?