swagger-api / swagger-api/swagger-codegen

[SWIFT 3] parseError("Could not decode date")

Open
#6,107 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Swift Issue: Bug
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Hi,

I contact you because I have an other problem with Swagger 2.3.0. When Swagger try to parse a field Date with nil value, we have this error.
But the field isn't required. so it can be nil ?

Thanks.

Julien

Swagger-codegen version

2.3.0

Swagger declaration file content or url
lastCo:
        type: string
        format: date-time
Command line used for generation

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i file:///myfile.yaml -l swift3 -o /myoutput --additional-properties responseAs=RxSwift

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

Reproduce the report with the supplied Swagger declaration and the swagger-codegen CLI command using the swift3 generator. Inspect the generated Swift handling of the optional date-time field and verify that a nil value decodes without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, swift
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.