glideapps / quicktype

Generate types and converters from JSON, Schema, and GraphQL

Home Page:https://app.quicktype.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enums are ALWAYS sorted

patrickdejong opened this issue · comments

As shown in the image below: image

Enums will always be sorted on their name alphabetically. This will lead to unexpected behaviour with values being swapped.

enum RandomDay{
Monday,
Tuesday,
Friday,
Sunday
}

will become:

enum RandomDay{
Friday,
Monday,
Sunday,
Tuesday
}

So the values do not match anymore. Could you make it an option to enable the alphabetic sorting?

Yeah, we saw this as well.
The generated code does not match the schema.

Source can be found here:

Related: #1289