Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Incorrect variable names generated for Swift #35

Open
aswathr opened this issue Apr 11, 2021 · 0 comments
Open

Incorrect variable names generated for Swift #35

aswathr opened this issue Apr 11, 2021 · 0 comments

Comments

@aswathr
Copy link

aswathr commented Apr 11, 2021

Trying to generate object models result in weird behaviour for Swift.
For example, I expect the following JSON:

{  
    "teamId": "$ùp@n0v@",
    "teamspaceId": 12345,
    "team_name": "supernova"
}

to generate a model like:

struct Untitled2 {
    let teamId: String
    let teamspaceId: Int
    let team_name: String
}

however, I get this:

struct Untitled2 {
    let teamID: String        // The 'd' in teamId is automatically uppercased
    let teamspaceID: Int         // Same as above
    let teamName: String        // The underscore is removed here and the var name is automatically camel-cased
}

Ok, so I checked the web version of quick type and it seems to generate the CodingKeys along with the code, which is neat, but it seems to be missing in the vs-code version

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant