You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using RouteBasedResourceStrategy, the generated self link for individual HAL resources is broken when the resource identifier references a property that contains an object, regardless of whether the object can be represented as a scalar value. In my specific case, I am using the ramsey/uuid-doctrine library which represents the ID as an object once the entity is hydrated with data from the database.
Previous behavior
Due to this library not previously checking explicitly for scalar values in RouteBasedResourceStrategy::createResource, and the UUID objects employing __toString (and other serialisation methods), the UUID object was accepted and the self links were generated as expected.
Current behavior
The property value of a mapped resource containing such an object is not passed through as a route parameter in RouteBasedResourceStrategy::createResource like it was before, resulting in the self link being broken. After updating from 1.3.1 to 1.4.0, all the self links are showing paths such as /some-resource/%7Bid%7D, instead of the value of the field (e.g. /some-resource/1b7e838c-5758-11eb-b1fe-0242281aebdd).
How to reproduce
It seems like this was a change specifically made as a result of a test in this library (commit a05bd84). Attempting to use a non-scalar value in this scenario, as described above, should suffice.
The text was updated successfully, but these errors were encountered:
BC Break Report
Summary
When using
RouteBasedResourceStrategy
, the generated self link for individual HAL resources is broken when the resource identifier references a property that contains an object, regardless of whether the object can be represented as a scalar value. In my specific case, I am using theramsey/uuid-doctrine
library which represents the ID as an object once the entity is hydrated with data from the database.Previous behavior
Due to this library not previously checking explicitly for scalar values in
RouteBasedResourceStrategy::createResource
, and the UUID objects employing__toString
(and other serialisation methods), the UUID object was accepted and the self links were generated as expected.Current behavior
The property value of a mapped resource containing such an object is not passed through as a route parameter in
RouteBasedResourceStrategy::createResource
like it was before, resulting in the self link being broken. After updating from 1.3.1 to 1.4.0, all the self links are showing paths such as/some-resource/%7Bid%7D
, instead of the value of the field (e.g./some-resource/1b7e838c-5758-11eb-b1fe-0242281aebdd
).How to reproduce
It seems like this was a change specifically made as a result of a test in this library (commit a05bd84). Attempting to use a non-scalar value in this scenario, as described above, should suffice.
The text was updated successfully, but these errors were encountered: