glideapps / glideapps/quicktype

[BUG] Quicktype generates models for json-schema simpletypes when generating from a directory to a single file

Open
#1,179 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
13.9k
Forks
1.2k
Avg merge
8h 53m
Merged PRs (30d)
369

Description

While attempting to find a workaround to #1169 I used the "generate from directory" syntax as follows

`quicktype ./schemas -o api.swift -l swift`

Here's a troubled sampling from result:

```
struct AnyOf: Codable {
let type: FluffyType
let pattern: AnyOfPattern?
}

enum AnyOfPattern: String, Codable {
case d = "^\\d+$"
}

enum PurplePattern: String, Codable {
case aZ0964 = "^[A-z0-9]{64}$"
case aZ151AZ15010AZ151 = "^([a-z1-5]{1}[a-z1-5\\.]{0,10}[a-z1-5]{1})$"
case aZ191AZ19_030AZ191 = "^([a-z1-9]{1}[a-z1-9_]{0,30}[a-z1-9]{1})$"
case aZ3AZ0950 = "[A-Z]{3}[A-z0-9]{50}"
case sigRK1091_AZ09 = "^SIG_[RK]{1}[0-9]{1}_[A-z0-9]+$"
case the09 = "[0-9]"
case the091320914AZ17 = "^([0-9]{1,32}.[0-9]{1,4} [A-Z]{1,7})$"
case the094092092T092092092 = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$"
case the094092092T092092092093 = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}$"
case the09AF09AF = "^(([0-9a-f][0-9a-f])+)?$"
case the10 = "^[10]$"
}
```

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.