Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #4763
Closed
Open
Issue created Dec 10, 2019 by Administrator@rootContributor5 of 5 checklist items completed5/5 checklist items

[BUG][TYPESCRIPT-RXJS] Format Date is converted to Date-Time

Created by: guidoknoll

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
Description

Hey,

when generating a parameter with the format 'date', it is falsely converted to 'date-time'. So in my case 'dateFrom' contains a time (e.g. '2019-12-10T17:56:56.999Z'), but should look like this: '2019-12-10'.

openapi-generator version

4.2.2

OpenAPI declaration file content or url
...
- name: date_from
          in: query
          description: >-
            Date parameter to search for ... (format\: \"yyyy-MM-dd\")
          required: false
          schema:
            type: string
            format: date
...
Command line used for generation

openapi-generator generate -i assets/api.yaml -g typescript-rxjs -o src/lib

Steps to reproduce
  • Generate the api
  • View the dateFrom parameter
Related issues/PRs
Suggest a fix

As in the typescript-fetch generator, write instead of .toISOString():

.toISOString().substr(0,10) or .toISOString().split('T')[0]

Assignee
Assign to
Time tracking