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
Today I wanted to change the identifier of an entity from an ordinary UUID to a name. Both the UUID and name are value objects. Their actual values are scalar private properties of the entities and the VOs are only an interface.
After I removed the UUID and changed the doctrine id to the name, API Platform registered that quite well in it's OpenAPI doc. Unfortunatly the actual operations were not working as described here: Stack Overflow Thread
The problem was, that I missed to add the __toString method to the name VO:
The documentation already has a section about custom identifiers: Identifiers. There is no information about the necessaty of the __toString method for this use case.
I am not quite sure where to put it and how to exlaint this use case. I guess not everybody uses VOs in this way. That's why I wanted to discuss that here. I will write an PR afterwards.
best regards,
spigandromeda
The text was updated successfully, but these errors were encountered:
Today I wanted to change the identifier of an entity from an ordinary UUID to a name. Both the UUID and name are value objects. Their actual values are scalar private properties of the entities and the VOs are only an interface.
The name VO looks like this:
After I removed the UUID and changed the doctrine id to the name, API Platform registered that quite well in it's OpenAPI doc. Unfortunatly the actual operations were not working as described here:
Stack Overflow Thread
The problem was, that I missed to add the __toString method to the name VO:
The documentation already has a section about custom identifiers: Identifiers. There is no information about the necessaty of the __toString method for this use case.
I am not quite sure where to put it and how to exlaint this use case. I guess not everybody uses VOs in this way. That's why I wanted to discuss that here. I will write an PR afterwards.
best regards,
spigandromeda
The text was updated successfully, but these errors were encountered: