glideapps / glideapps/quicktype

Using web interface creates swift Codable with type Int for 0.0 value

Open
#2,195 1 comment 3 reactions 0 assignees View on GitHub
bug Python rendering Swift
Dominant language
TypeScript
Stars
13.9k
Forks
1.2k
Avg merge
8h 53m
Merged PRs (30d)
369

Description

### Steps to reproduce:
1. Open https://app.quicktype.io/
2. Enter this JSON as the model:
```
{
"double_value": 0.0
}
```
3. Generated codable:
```
struct CustomModel: Codable {
let doubleValue: Int

enum CodingKeys: String, CodingKey {
case doubleValue = "double_value"
}
}
```

I would expect to get:
```
let doubleValue: Double
```
and it works correctly when value is different from `0.0`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.