swagger-api / swagger-api/swagger-codegen

Cannot Convert Number (eg. 2208.72) to Float Value

Open
#7,995 2 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

I had to update Xcode to the new Version and therefore Swift 4.1 was updated.
Now I get an error mapping Numbers to a Float Value.

Swagger-codegen version

swagger-codegen-cli-2.3.1

Swagger declaration file content or url

I cannot post the swagger file due to security reasons, but i can look for specific parts if needed.

Here is the part of the generated code, where it fails
codegen_2_3_1_float_error

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

Review the generated Swift code shown in the issue alongside the Swagger declaration, whose relevant parts the reporter can provide. Reproduce the number-to-Float mapping with Swift 4.1 and Xcode using a value such as 2208.72; done means the generated client maps that value without the reported error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.