swagger-api / swagger-api/swagger-codegen-generators

Swift4 Codegen Date and DateTime error

Open
#403 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
299
Forks
439
PR merge metrics
No merged PRs in 30d

Description

Hi everybody, when using Swift4 Swagger Codegen, there's a problem in distinguishing Date and DateTime types declared in swagger, which gets both converted to Date: https://github.com/swagger-api/swagger-codegen-generators/blob/master/src/main/java/io/swagger/codegen/v3/generators/swift/Swift4Codegen.java#L80-L81

This wasn't a problem in Swift 3, where the the two types were different: https://github.com/swagger-api/swagger-codegen-generators/blob/master/src/main/java/io/swagger/codegen/v3/generators/swift/Swift3Codegen.java#L38-L39

Has anyone had the same problem? Most of all, how should we address it and solve it?

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

Start with the Swift4Codegen.java mapping at the referenced lines and compare it with Swift3Codegen.java. Determine how Swift 4 should distinguish Swagger Date and DateTime types, then verify that generated Swift models preserve that distinction.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, swift
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.