Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error with Swagger Editor petstore example #63

Open
amacfie opened this issue Mar 15, 2024 · 2 comments
Open

error with Swagger Editor petstore example #63

amacfie opened this issue Mar 15, 2024 · 2 comments

Comments

@amacfie
Copy link

amacfie commented Mar 15, 2024

Describe the bug
OpenAPI v3.0.3 file has an error and client not generated

To Reproduce
The file openapi.json is from https://editor.swagger.io/ (File | Convert and save as JSON). It has the following error:

$ openapi-python-generator --version
openapi-python-generator, version 0.5.0

$ openapi-python-generator ./openapi.json client1
Generating data from ./openapi.json
Traceback (most recent call last):
  File "/tmp/plop/.venv/bin/openapi-python-generator", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/tmp/plop/.venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/plop/.venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/tmp/plop/.venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/plop/.venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/plop/.venv/lib/python3.11/site-packages/openapi_python_generator/__main__.py", line 56, in main
    generate_data(
  File "/tmp/plop/.venv/lib/python3.11/site-packages/openapi_python_generator/generate_data.py", line 149, in generate_data
    result = generator(
             ^^^^^^^^^^
  File "/tmp/plop/.venv/lib/python3.11/site-packages/openapi_python_generator/language_converters/python/generator.py", line 39, in generator
    services = generate_services(data.paths, library_config)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/plop/.venv/lib/python3.11/site-packages/openapi_python_generator/language_converters/python/service_generator.py", line 325, in generate_services
    sync_so = generate_service_operation(op, path_name, False)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/plop/.venv/lib/python3.11/site-packages/openapi_python_generator/language_converters/python/service_generator.py", line 279, in generate_service_operation
    params = generate_params(op)
             ^^^^^^^^^^^^^^^^^^^
  File "/tmp/plop/.venv/lib/python3.11/site-packages/openapi_python_generator/language_converters/python/service_generator.py", line 150, in generate_params
    raise Exception(
Exception: Unsupported request body type: <class 'openapi_schema_pydantic.v3.v3_1_0.request_body.RequestBody'>
@yswtrue
Copy link

yswtrue commented Mar 16, 2024

same here

@setu4993
Copy link

setu4993 commented Aug 2, 2024

I'm seeing the same issue on my OpenAPI v3.1.0 spec that was created with FastAPI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants