AbsaOSS / AbsaOSS/enceladus

Unification of absent values serialization in JSON.

オープン
#2,074 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
feature priority: undecided under discussion
主要言語
Scala
スター
33
フォーク
16
PR マージ指標
30日以内にマージされた PR はありません

説明

## 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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。