Skip to content

Commit

Permalink
Change JsonInclude.NON_EMPTY to NON_NULL
Browse files Browse the repository at this point in the history
Due to some specification related to JsonInclude.NON_EMPTY, the
generated openapi.json ignores a collection annoted with NON_EMPTY.

For a consistent behavior, we'll use NON_NULL for collections.

Signed-off-by: Moti Asayag <masayag@redhat.com>
  • Loading branch information
masayag authored and openshift-merge-robot committed May 8, 2023
1 parent b456934 commit 9279d5a
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
@JsonIgnoreProperties(ignoreUnknown = true)
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class WorkDefinitionResponseDTO {

private UUID id;
Expand All @@ -56,19 +57,14 @@ public class WorkDefinitionResponseDTO {

private String workType;

@JsonInclude(JsonInclude.Include.NON_NULL)
private WorkFlowProcessingType processingType;

@JsonInclude(JsonInclude.Include.NON_NULL)
private String author;

@JsonInclude(JsonInclude.Include.NON_NULL)
private List<WorkDefinitionResponseDTO> works;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
private Map<String, Map<String, Object>> parameters;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<WorkFlowTaskOutput> outputs;

@JsonIgnore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ public class WorkFlowDefinitionResponseDTO {

private Date modifyDate;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_NULL)
private Map<String, Map<String, Object>> parameters;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_NULL)
private WorkFlowPropertiesDefinitionDTO properties;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_NULL)
private List<WorkDefinitionResponseDTO> works;

public static class WorkFlowDefinitionResponseDTOBuilder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class WorkFlowContextResponseDTO {

private UUID workFlowExecutionId;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_NULL)
private WorkFlowOptionsResponseDTO workFlowOptions;

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class WorkFlowOptionsResponseDTO {

private WorkFlowOption currentVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class WorkFlowResponseDTO {

private UUID workFlowExecutionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class WorkFlowStatusResponseDTO {

private String status;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_NULL)
private List<WorkStatusResponseDTO> works;

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class WorkStatusResponseDTO {

private ParodosWorkStatus status;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_NULL)
private List<WorkStatusResponseDTO> works;

@JsonIgnore
Expand Down

0 comments on commit 9279d5a

Please sign in to comment.