api-platform / core

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

fix(jsonld): allow @id, @context and @type on denormalization #6402

Open soyuka opened 4 weeks ago

soyuka commented 4 weeks ago

6225

ili101 commented 4 weeks ago

General question. I think I saw it written somewhere but I can't find it now. What is the easiest way to test a fork? like in an existing api-platform template clone, replace the /vendor/api-platform/core with the peached version to see if it works.

Anyway I think it's not working as in Symfony here isAllowedAttribute() is not called if it's not in $allowedAttributes that is set here from:

https://github.com/api-platform/core/blob/73a4c324a3fe8d7e40ed2232c1e91cd0b4731805/src/Serializer/AbstractItemNormalizer.php#L418-L443

where $allowedAttributes = []; is empty and gets filled only with items from the object && isAllowedAttribute() and in our case there are not in the object so isAllowedAttribute() is not checked.

soyuka commented 2 weeks ago

Hi, the best way to test the branch is to use https://getcomposer.org/doc/05-repositories.md#vcs with the fork and the branch