Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date type generation inconsistent between object and array #602

Open
GavinChenYan opened this issue Nov 10, 2021 · 0 comments
Open

Date type generation inconsistent between object and array #602

GavinChenYan opened this issue Nov 10, 2021 · 0 comments

Comments

@GavinChenYan
Copy link
Contributor

GavinChenYan commented Nov 10, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant