Is your feature request related to a problem? Please describe.
When parsing a jsonschema, if jsonschema title contains underscore, a pydantic class name will be created without underscore (it will be joined).
Example title: "ACTION_NAME"
Example class title name output: "ACTIONNAME"
Describe the solution you'd like
I'd like an option to keep the title name
Describe alternatives you've considered
I used custom_class_name_generator flag to pass dummy function to keep the name but it still gets translated, function is called, though (i added little print function before return to make sure it's called)
from datamodel_code_generator import generate
from pathlib import Path
def keep_underscore(name):
return name.replace('_', '_')
generate(Path('action_name.json'), output=Path('model.py'), input_file_type='jsonschema', custom_class_name_generator=keep_underscore,)
Additional context
I believe there is already a way to do it just can't figure out out what.
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