swagger-api / swagger-api/swagger-codegen

Kotlin DateTime type autogenerate bug

Open
#11,007 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

Swagger documentation suggest that for date-time we need to have Instant type not LocalDateTime type
image
From swagger example "2017-07-21T17:32:28Z" is Instant

So in swagger-codegen/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractKotlinCodegen.java need to change the lines with LocalDateTime to Instant
image

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

Open swagger-codegen/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractKotlinCodegen.java and locate the date-time mappings that currently use LocalDateTime. Confirm the Swagger example represents an Instant, then update the relevant mappings so generated Kotlin code uses Instant and verify the generated type matches the documented format.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin, openapi
Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.