Describe the bug
It produces a Enumeration with key with None_
prepended and without quotes around the value
Traceback (most recent call last):
File "/Users/tomhemmes/miniconda3/envs/py38/lib/python3.8/site-packages/datamodel_code_generator/__main__.py", line 244, in main
generate(
File "/Users/tomhemmes/miniconda3/envs/py38/lib/python3.8/site-packages/datamodel_code_generator/__init__.py", line 202, in generate
results = parser.parse()
File "/Users/tomhemmes/miniconda3/envs/py38/lib/python3.8/site-packages/datamodel_code_generator/parser/base.py", line 354, in parse
body = format_code(body, self.target_python_version)
File "/Users/tomhemmes/miniconda3/envs/py38/lib/python3.8/site-packages/datamodel_code_generator/format.py", line 26, in format_code
code = apply_black(code, python_version)
File "/Users/tomhemmes/miniconda3/envs/py38/lib/python3.8/site-packages/datamodel_code_generator/format.py", line 41, in apply_black
return black.format_str(
File "/Users/tomhemmes/miniconda3/envs/py38/lib/python3.8/site-packages/black.py", line 725, in format_str
src_node = lib2to3_parse(src_contents.lstrip(), mode.target_versions)
File "/Users/tomhemmes/miniconda3/envs/py38/lib/python3.8/site-packages/black.py", line 836, in lib2to3_parse
raise exc from None
black.InvalidInput: Cannot parse: 10:23: None_Item_1 = Item 1
To Reproduce
Example schema:
{
"$id": "item_types.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "item_types",
"description": "JSON Schema for item_types",
"type": "array",
"items": {
"enum": [
"Item 1",
"Item 2",
"Item 3"
]
}
}
Used commandline:
$ datamodel-codegen --input test.json --input-file-type jsonschema --output test.py
Expected behavior
A clear and concise description of what you expected to happen
Version:
Additional context
Add any other context about the problem here.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too