glideapps / quicktype

Generate types and converters from JSON, Schema, and GraphQL
https://app.quicktype.io
Apache License 2.0
12.31k stars 1.07k forks source link

Enum schemas aren't generated if the enumerator list matches #2484

Open beku-epitome opened 8 months ago

beku-epitome commented 8 months ago

I have two JSON schema files, where the type names are different, but the enumerators are matching.

{ "title":"firstEnumeration","enum": ["a","b","c"],"type": "string"}
{ "title":"secondEnumeration","enum": ["a","b","c"],"type": "string"}

When I use quicktype to generate source code, I only get output for the secondEnumeration, even though they are two different types - there is also no alias type generated for firstEnumeration, it is simply an unknown symbol. This problem is observed across multiple output languages, so the logic to blame must be in the JSON schema parsing logic.