python fastapi-codegen でエラーがでてた。TypeError: Mode.__init__() got an unexpected keyword argument 'experimental_string_processing' fastapi-codegen fastapi-codegen

Python のバージョン 3.10.13 環境で、fastapi-codegen 公式サイトのサンプルを使い実行するとエラーがでてた。
fastapi-codegen --input api.yaml --output app を実行すると以下のエラー。
いろいろ試したが結果的には、pythonバージョン 3.7 の環境にすると実行できた。
理由はわからないけど、とりあえずメモ。

TypeError: Mode.__init__() got an unexpected keyword argument 'experimental_string_processing' がでたときのエラーが以下。

│ │
│ 105 │ │ if TYPE_CHECKING: │
│ 106 │ │ │ self.black_mode: black.FileMode │
│ 107 │ │ else: │
│ ❱ 108 │ │ │ self.black_mode = black.FileMode( │
│ 109 │ │ │ │ target_versions={BLACK_PYTHON_VERSION[python_version]}, │
│ 110 │ │ │ │ line_length=config.get("line-length", black.DEFAULT_LINE_LENGTH), │
│ 111 │ │ │ │ string_normalization=not skip_string_normalization │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ black_kwargs = {'experimental_string_processing': False} │ │
│ │ config = {} │ │
│ │ experimental_string_processing = False │ │
│ │ path = PosixPath('/pyproject.toml') │ │
│ │ python_version = <PythonVersion.PY_37: '3.7'> │ │
│ │ root = PosixPath('/') │ │
│ │ self = <datamodel_code_generator.format.CodeFormatter object at │ │
│ │ 0x7fd4bb28b6a0> │ │
│ │ settings_path = PosixPath('/var/www/html/generator_script/app') │ │
│ │ skip_string_normalization = True │ │
│ │ wrap_string_literal = False │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: __init__() got an unexpected keyword argument 'experimental_string_processing'