api-platform / core

The server component of API Platform: hypermedia and GraphQL APIs in minutes
https://api-platform.com
MIT License
2.45k stars 881 forks source link

add operation attribute to hydra response #2588

Open arnedesmedt opened 5 years ago

arnedesmedt commented 5 years ago

Hi,

Is it possible now to add the operation attribute to your hydra response? It's explained in the hydra documentation: https://www.hydra-cg.com/spec/latest/core/#example-6-a-representation-of-an-issue-augmented-with-a-delete-operation

I've searched the codebase and found that their is a JsonLdContextTrait.php that will add a context, but I couldn't find a trait that adds the operations of the resource to the response.

Thx in advance! Arne

soyuka commented 5 years ago

You need to check either the Hydra normalization https://github.com/api-platform/core/tree/master/src/Hydra/Serializer or the jsonld ItemNormalizer https://github.com/api-platform/core/tree/master/src/JsonLd/Serializer that uses the JsonLdContextTrait!

This would be a good enhancement!