Closed spinillos closed 2 months ago
When we serialize scalar disjunctions, it was setting the whole struct when we only need the filled value.
Example:
public class StringOrArray { public String string; public Array array; } public class Other { @JsonProperty("value") public StringOrArray value; }
it was generating:
{ "value": { "string": "myString" } }
or
{ "value": { "array": ["myString"] } }
When we were expecting:
{ "value" : "myString" }
{ "value": ["myString"] }
And for deserializer, we need to check the proper type of the value received in the json to know what of the values we need to set.
And extra: It fixes an issue in the test that was setting a prometheus dataquery into a loki one 🙃.
Note: in addition to the changes introduced by this PR, the diff includes unreleased changes living in main.
main
When we serialize scalar disjunctions, it was setting the whole struct when we only need the filled value.
Example:
it was generating:
or
When we were expecting:
And for deserializer, we need to check the proper type of the value received in the json to know what of the values we need to set.
And extra: It fixes an issue in the test that was setting a prometheus dataquery into a loki one 🙃.