Date type generation inconsistent between object and array
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
No source files or tests are identified in the issue. Start by tracing OpenAPI date-format handling for scalar fields and array items in the Java code generator, then compare the generated model types; done means an array of format date generates java.util.List consistently with a scalar date field.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Java
- Stars
- 49
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from networknt/light-codegen
-
enhancement help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
networknt/light-codegen#350 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
networknt/light-codegen#674 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 20/100
networknt/light-codegen#666 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
networknt/light-codegen#616 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
networknt/light-codegen#603 · 2 comments ·
All issues in networknt/light-codegen
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100