-
-
Notifications
You must be signed in to change notification settings - Fork 263
-
Hello,
i installed the current version via pip and tried to generate a client but it fails with this error:
C:\Temp\DeDeSales_api>openapi-python-client generate --path dededsales.xml
Traceback (most recent call last):
File "C:\Users\re\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\re\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\re\AppData\Local\Programs\Python\Python39-32\Scripts\openapi-python-client.exe\__main__.py", line 4, in <module>
from openapi_python_client.cli import app
File "C:\Users\re\AppData\Local\Programs\Python\Python39-32\lib\site-packages\openapi_python_client\__init__.py", line 22, in <module>
from .parser import GeneratorData, import_string_from_class
File "C:\Users\re\AppData\Local\Programs\Python\Python39-32\lib\site-packages\openapi_python_client\parser\__init__.py", line 5, in <module>
from .openapi import GeneratorData, import_string_from_class
File "C:\Users\re\AppData\Local\Programs\Python\Python39-32\lib\site-packages\openapi_python_client\parser\openapi.py", line 14, in <module>
from .bodies import Body, body_from_data
File "C:\Users\re\AppData\Local\Programs\Python\Python39-32\lib\site-packages\openapi_python_client\parser\bodies.py", line 6, in <module>
from openapi_python_client.parser.properties import (
File "C:\Users\re\AppData\Local\Programs\Python\Python39-32\lib\site-packages\openapi_python_client\parser\properties\__init__.py", line 35, in <module>
from .model_property import ModelProperty, process_model
File "C:\Users\re\AppData\Local\Programs\Python\Python39-32\lib\site-packages\openapi_python_client\parser\properties\model_property.py", line 341, in <module>
ANY_ADDITIONAL_PROPERTY = AnyProperty.build(
File "C:\Users\re\AppData\Local\Programs\Python\Python39-32\lib\site-packages\openapi_python_client\parser\properties\any.py", line 25, in build
return cls(
TypeError: AnyProperty() takes no arguments
Name: openapi-python-client
Version: 0.24.0
Summary: Generate modern Python clients from OpenAPI
Home-page:
Author:
Author-email: Dylan Anthony <contact@dylananthony.com>
License: MIT
Location: c:\users\re\appdata\local\programs\python\python39-32\lib\site-packages
Requires: attrs, colorama, httpx, jinja2, pydantic, python-dateutil, ruamel-yaml, ruff, shellingham, typer, typing-extensions
Required-by:
This error comes also when i just call "openapi-python-client" without parameters. It is generally not working.
I tried reinstall and checked for broken requierements. Checked the requirements manually too, the version are all greater.
Any hint how to slove this?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 2 replies
-
That is a very strange error, and I'm not sure what could have caused it 🤔. The only thing that stands out to me is --path dededsales.xml, since this generator doesn't accept XML format, only JSON and YAML OpenAPI specifications. I don't know how an invalid input file would cause this error, though.
Could you provide an example file for me to reproduce this with?
Beta Was this translation helpful? Give feedback.
All reactions
-
Oh, was a typo. The same error comes with .json too.
I attached the file.
dedesales.json
Beta Was this translation helpful? Give feedback.
All reactions
-
I tried the current version of python 3.13.2, there it works.
Version 3.9.7 fails with the error AnyProperty().
Beta Was this translation helpful? Give feedback.
All reactions
-
I can reproduce for specifically 3.9.7, but I spot checked a few newer patch versions (3.9.8, 3.9.10, 3.9.14, 3.9.21) and they all worked fine. So seems like maybe this was a bug in Python itself. Are you able to upgrade to a newer patch version?
Beta Was this translation helpful? Give feedback.