Skip to content

Date type generation inconsistent between object and array #602

@GavinChenYan

Description

@GavinChenYan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions