REST API: creating the same composite with multi-values twice throws "Duplicate Exception"
Try this via REST API:
- create a Person with a Phone Entry
- send the very same create-request a 2nd time
A "Duplicate Exception" is thrown (actually not for the Person topic, but for a Phone Entry association).
The correct behavior would be for the 2nd request to have no effect, as Person is an identity type, and the 2nd create-request would actually identify the existing person (created by the first request) as the target for an update-operation. That update is supposed to have no effect as all values exist already.
This happens if the requests contains no id
s for multi-values.
Note: in order to send a request that replaces a certain value by another one the REST API allows you to specify the id
of the value to replace. (The new value must be wrapped in a topic object, with id
referring to the to-be-replaced value.) Such an request is sent e.g. by the Webclient when replacing a Person's phone number by another one.
If on the other hand no id
is contained in the request the Value Integrator interprets this as new value. This is the case e.g. in the Webclient when adding a new Phone Entry (by pressing "+"). The Value Integrator then creates an association from parent topic to the new value. In the scenario with 2 identical create-requests this association causes a "Duplicate Exception".
This is a follow-up to #355 (closed)
Thanks to @jpn for reporting!
@mukil FYI