Unification of absent values serialization in JSON.
- Lingua principale
- Scala
- Stelle
- 33
- Fork
- 16
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
## Background
In Enceladus API V2 (and further on in V3), there are multiple serialization techniques used to get JSON representation of objects, and currently, they behave differently in terms of _absent_ fields serialization (`None` represented as `null`, true `null`s).
The first approach is the `ObjectMapper` used by native object mapping (Datasets, Schemas, MTs, PropDefs, ...), defined in [rest_api.Application](https://github.com/AbsaOSS/enceladus/blob/develop-ver-3.0/rest-api/src/main/scala/za/co/absa/enceladus/rest_api/Application.scala#L49). This unfortunately lacks the `.setSerializationInclusion(Include.NON_ABSENT)` option to omit the empty fields during serialization.
The second approach used leverages `atum.utils.SerializationUtils.asJson` (e.g. used for Runs) that is configured to omit absent fields.
This dichotomy results in a differently looking JSON representation within a single REST API service.
The catch here is that direct unification would directly affect the current V2 serialization that is used - this may or may not be an issue, which is to be determined.
This became clear during https://github.com/absaoss/enceladus/issues/1692.
## Feature
Unifiy the serialization approach if possible.
## Example [Optional]
```json
{
"name":"propertyDefinition1",
"version":23,
"description":null,
"propertyType":{"_t":"StringPropertyType","suggestedValue":null},
...
}
```
vs
```json
{
"name":"propertyDefinition1",
"version":23,
"propertyType":{"_t":"StringPropertyType"},
...
}
```
## Proposed Solution [Optional]
Solution Ideas:
1. adjust the object mapper with `.setSerializationInclusion(Include.NON_ABSENT)` and reflect in testcases and test the UI @ API v2
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.