[BUG]: Error generating lottie scheme code
Issue Type
When trying to generate code from a schema I get an error
Context (Environment, Version, Language)
Input Format: json schema Output Language: C#
CLI, npm, or app.quicktype.io: CLI and app.quicktype.io Version: 23.0.170
Description
I'm trying to generate a c# class from the schema provided by lottie at https://lottiefiles.github.io/lottie-docs/schema/lottie.schema.json. I copy the raw into a utf-8 file and submit it to the CLI command or copy it directly from the link and paste it into the website https://app.quicktype.io/
Input Data
I think it is too big to isolate into something smaller and understandable, I will leave again the link of the schema provided: https://lottiefiles.github.io/lottie-docs/schema/lottie.schema.json
Expected Behaviour / Output
Generate schema classes
Current Behaviour / Output
Nothing appears on the website and the CLI returns the message: "Error: s.codePointAt is not a function."
Steps to Reproduce
- Download the json schema from the above link
- Save it in a local file with the name "lottie.schema.json"
- Run the following command "quicktype -s schema lottie.schema.json -o src/Models.cs" in the same directory
I've replicated this issue as well. I've found it comes down to this culprit, a property with the following type:
oneOf:
- const: 0
title: CONST_ZERO
- const: 1
title: CONST_ONE
- const: 2
title: CONST_TWO
It seems the system has issues with generating int-based enums? I'm trying it with the Python generator at the moment.
Here's where this bug triggers from the Lottie JSON schema from above:
"oneOf": [
{
"title": "True",
"const": 1
},
{
"title": "False",
"const": 0
}
]