OpenAPITools / OpenAPITools/openapi-generator
typescript-rxjs generator call toISOString() on string format date
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
generator v 6.1.2
the interface clearly declare
incidentDate?: string;
but in the function it was generated as
if (incidentDate != null) { query['incidentDate'] = (incidentDate as any).toISOString().split('T')[0]; }
in swagger.json
{
"name": "incidentDate",
"in": "query",
"style": "form",
"schema": {
"type": "string",
"format": "date"
}
}
If I passed Date object it won't compile
If I passed string I got ERROR TypeError: incidentDate.toISOString is not a function
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 swagger.json schema and the generated TypeScript RxJS client function that serializes incidentDate. Reproduce the mismatch using a string value and compare it with the declared interface type. Done means date-format query parameters accept the documented string type without calling an unavailable method or producing a runtime error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100