light-codegen icon indicating copy to clipboard operation
light-codegen copied to clipboard

Date type generation inconsistent between object and array

Open GavinChenYan opened this issue 4 years ago • 0 comments

In openapi, if the field defined as date format:

    startDate:
      type: "string"
      format: "date"

Codegen will generate the field as LocalDate in the model.

@JsonProperty("startDate")
public java.time.LocalDate getStartDate() {
    return startDate;
}

But for the array (list) with same definition:

    datelist:
      type: "array"
      items:
        type: "string"
        format: "date"

Codegen will generate field as String List.

@JsonProperty("datelist")
public java.util.List<String> getDatelist() {
    return datelist;
}

We should make it consistent to be list of LocalDate

GavinChenYan avatar Nov 10 '21 00:11 GavinChenYan