Closed bertramakers closed 7 months ago
Yes you're right! Will fix soon. Sorry for all the breaking changes!
Thanks for the quick response! No worries, I knew at least one breaking change was coming for the field names. Extracting the type definitions to separate classes is a bit more work to refactor it on our end now, but I understand your logic and agree it makes sense.
Hi @tobyzerner . I was processing your comments on my PR/issues, which mentioned quite a lot of breaking changes. While refactoring our app to be compatible with the latest version again, I ran into the following issue.
Before the refactor to Types, I had a field like this:
Note that
NzcEmissionDomain
is a string-backed enum in our application.I refactored this particular field to this:
However, when I now include a value for it in a create/update request, I get the following
Error
:This is caused by
Attribute
calling theserialize()
method onStr
first before calling the custom serialization function (here). And theStr::serialize()
method tries to cast the value to a string (here), which will fail if it's a type that cannot be cast automatically. The purpose of the custom serialize method seemed to me to prevent this, so I would assume that it should be called first instead?