-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Labels
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
When calling an API with a null date, you can't because the typescript type is wrong, and if you fudge it, it will throw an error because .toISOString does not exist on null.
openapi-generator version
5.3.0
OpenAPI declaration file content or url
openapi: 3.0.3
info:
title: Example
version: v1
paths: {}
components:
schemas:
Date:
type: string
format: date-time
nullable: trueGeneration Details
{
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "5.3.0",
"generators": {
"user-api": {
"generatorName": "typescript-fetch",
"output": "src/libs/user-api",
"inputSpec": "https://.../users/v1/docs/spec/public/users/openapi.yml",
"additionalProperties": {
"modelPropertyNaming": "original",
"enumNameSuffix": ""
}
}
}
}
}Steps to reproduce
Run openapi-generator-cli generate
Related issues/PRs
Suggest a fix
Make types:
col?: Date | null;Make coverter:
'col': value.col === undefined ? undefined : (value.date_of_birth.toISOString()),Reactions are currently unavailable