OpenAPITools / OpenAPITools/openapi-generator
[BUG] Field declare as Date is not Recognize as isDate is mustache
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Field declare as Date is not Recognize as isDate is mustache.
- Spec has field of type Date .
- we have written our own converter by extends SpringCodegen implements CodegenConfig
- Once we run generator we are noticing that the model json is not update isDate property as true for "openApiType" : "Date",
yaml
generatorTime:
deprecated: true
format: date-time
type: string
model json
"openApiType" : "Date",
"baseName" : "generatorTime",
"isDate" : false,
"isDateTime" : false,
Mustache
{{#isDate}}
@JsonProperty("{{baseName}}")
{{/isDate}}
now above mustache condition failed since isDate is false. right now i am using openapi-generator-5.4.0 version .
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.
Research direction
Start with the custom SpringCodegen implementation and the supplied YAML field, then run openapi-generator 5.4.0 and inspect the model JSON metadata. Compare how the generator classifies date and date-time fields before the Mustache template is rendered. Done means the documented Date field produces the expected isDate value and the template condition behaves accordingly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100