-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
At the time of writing, we did not find it possible to nullify a previously set optional field, such as the location of an event. After an event is created with a location value, any requests received with a null or non specified location value, are overridden by the pre-existing value in the objectMapper.updateValue(entity, this) in EntityDto.
Discussed solutions include:
- Replacing optional fields like
String?withOptional<String?>, and writing a customupdate()function forEntityDto, where:- empty = key missing in JSON
- present + null = key with null value in JSON
- present + non-null = key with a value in JSON
- Assuming a true
PUTfashion to requests where the dto replaces the whole of the previous entity. This may be problematic because of fields not included in the endpoints, likeassociatedRoles. Some custom case-by-case logic may be required in controllers to deal with these fields - Introduce custom controller logic to deal with
nullfields - Implement a
PATCHwrapper as explained here or follow the approach defined here
Because this will only affect the usage of the internal forms, and is ""avoidable"" by giving the field a value like -, we decided not to attempt any of these solutions at the moment as the disturbance to the backend is potentially large and may the delay the MVP timeline further.
Metadata
Metadata
Assignees
Labels
No labels