Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unification of absent values serialization in JSON. #2074

Open
dk1844 opened this issue May 31, 2022 · 0 comments
Open

Unification of absent values serialization in JSON. #2074

dk1844 opened this issue May 31, 2022 · 0 comments
Labels
feature New feature priority: undecided Undecided priority to be assigned after discussion under discussion Requires consideration before a decision is made whether/how to implement

Comments

@dk1844
Copy link
Contributor

dk1844 commented May 31, 2022

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 nulls).

The first approach is the ObjectMapper used by native object mapping (Datasets, Schemas, MTs, PropDefs, ...), defined in rest_api.Application. 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 #1692.

Feature

Unifiy the serialization approach if possible.

Example [Optional]

{
  "name":"propertyDefinition1",
  "version":23,
  "description":null,
  "propertyType":{"_t":"StringPropertyType","suggestedValue":null},
  ...
}

vs

{
  "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
@dk1844 dk1844 added feature New feature under discussion Requires consideration before a decision is made whether/how to implement priority: undecided Undecided priority to be assigned after discussion labels May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature priority: undecided Undecided priority to be assigned after discussion under discussion Requires consideration before a decision is made whether/how to implement
Projects
None yet
Development

No branches or pull requests

1 participant