In Athenz, we have a class called Access which has a single boolean field granted which returns whether the authorization check is successful or failed:
{"granted":true} or {"granted":false"}
However, with the use of @JsonSerialize(include = JsonSerialize.Inclusion.NON_DEFAULT) annotation, Jackson library skips the default value of false for the granted attribute and generates the json object as {} which is invalid. The client was expecting to see the "granted" attribute in response with the false value.
The model generator must provide the option to use different annotations which generate the expected output: e.g.:
When generating java model classes, the generator uses the following annotation:
@JsonSerialize(include = JsonSerialize.Inclusion.NON_DEFAULT)
In Athenz, we have a class called Access which has a single boolean field granted which returns whether the authorization check is successful or failed: {"granted":true} or {"granted":false"}
However, with the use of @JsonSerialize(include = JsonSerialize.Inclusion.NON_DEFAULT) annotation, Jackson library skips the default value of false for the granted attribute and generates the json object as {} which is invalid. The client was expecting to see the "granted" attribute in response with the false value.
The model generator must provide the option to use different annotations which generate the expected output: e.g.:
@JsonSerialize(include = JsonSerialize.Inclusion.ALWAYS)