Property setters are called twice

Description

Looks like property setters are called twice as seen https://github.com/openmrs/openmrs-module-webservices.rest/blob/2.37.0/omod-common/src/main/java/org/openmrs/module/webservices/rest/web/ConversionUtil.java#L313-L332, for some resources this leads to a bug where if the setter is for a collection or an array, the collection items are added twice resulting in duplicates when creating a new resource that has a child collection.

I believe this can only be reproduced with 2 levels of nesting of collections e.g. a visit has a collection of encounters and each encounter can have a collection of obs, so if you try to create a new visit with an encounter with some observations.

Attachments

1

Activity

Show:

Frédéric Deniger March 15, 2024 at 1:59 PM

the PR https://github.com/openmrs/openmrs-module-webservices.rest/pull/581 broke some api calls. For instance in the patient registration, if we use some property with answerConceptSetUuid the concept are saved with uuid and no more with the concept_id.

Would it be possible to revert the commit or the fix this new issue

Ryan McCauley August 3, 2023 at 10:23 AM
Edited

Created a PR for this - https://github.com/openmrs/openmrs-module-webservices.rest/pull/581 I realised the status has been sitting at "Needs Assessment" so I maybe jumped in too soon but the PR is here if the task still needs completed. I will also avoid updating the status in this case.

Fixed

Details

Assignee

Reporter

Complexity

Medium

Fix versions

Priority

Created October 18, 2022 at 4:32 AM
Updated March 15, 2024 at 3:25 PM
Resolved August 24, 2023 at 1:19 PM