swagger-api / swagger-api/swagger-codegen

[Kotlin] Swagger date type mapped to localdatetime instead of localdate

Open
#9,285 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description
Swagger-codegen version

3.0.5

Swagger declaration file content or url

Example

              presentation_start_date:
                type: string
                format: date

Configuration

{
  "dateLibrary":"java8",
  "sourceFolder": "build/generated/swagger/",
  "enumPropertyNaming": "UPPERCASE"
}
Steps to reproduce

Generate code

java -Dmodels -DmodelDocs=false -Dio.swagger.parser.util.RemoteUrl.trustAll=true -jar swagger-codegen-cli-3.0.5.jar \
-i  ./contract.yml \
-l kotlin-client \
-c $kotlin_config_loc \
--model-package com.something

Get this

    val presentationStartDate: java.time.LocalDateTime? = null`
Related issues/PRs
Suggest a fix/enhancement

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by running the provided swagger-codegen 3.0.5 command with the Kotlin client and the shown date schema, then trace the kotlin-client date mapping; done means the generated presentationStartDate uses java.time.LocalDate rather than LocalDateTime.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.