Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

TypeError: AnyProperty() takes no arguments #1219

Unanswered
iconberg asked this question in Q&A
Discussion options

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?

You must be logged in to vote

Replies: 2 comments 2 replies

Comment options

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?

You must be logged in to vote
1 reply
Comment options

Oh, was a typo. The same error comes with .json too.
I attached the file.
dedesales.json

Comment options

I tried the current version of python 3.13.2, there it works.
Version 3.9.7 fails with the error AnyProperty().

You must be logged in to vote
1 reply
Comment options

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /