Skip to content

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

Description

@dskvr

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]$"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions