Closed bandwiches closed 4 months ago
Some additional information...
[2024-05-20 13:11:19,136] ERROR in app: Exception on request GET /openapi.json
Traceback (most recent call last):
File "...\Lib\site-packages\quart\app.py", line 1403, in handle_request
return await self.full_dispatch_request(request_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\quart\app.py", line 1441, in full_dispatch_request
result = await self.handle_user_exception(error)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\quart\app.py", line 1029, in handle_user_exception
raise error
File "...\Lib\site-packages\quart\app.py", line 1439, in full_dispatch_request
result = await self.dispatch_request(request_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\quart\app.py", line 1535, in dispatch_request
return await self.ensure_async(handler)(**request_.view_args) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\quart_schema\extension.py", line 321, in openapi
return jsonify(_build_openapi_schema(current_app, self))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\quart_schema\extension.py", line 657, in _build_openapi_schema
built_paths, components = _build_path(func, rule, app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\quart_schema\extension.py", line 490, in _build_path
schema = model_schema(
^^^^^^^^^^^^^
File "...\Lib\site-packages\quart_schema\conversion.py", line 209, in model_schema
return TypeAdapter(model_class).json_schema(ref_template=PYDANTIC_REF_TEMPLATE)
^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: TypeAdapter() takes no arguments
[2024-05-20 13:11:19 -0500] [15108] [INFO] 127.0.0.1:58139 GET /openapi.json 1.1 500 265 2018
[2024-05-20 13:11:19 -0500] [15108] [INFO] 127.0.0.1:58139 GET /openapi.json 1.1 - - 2018
Can't upload another image for some reason. This loads an actual page, but the results are a Failed to load API definition
error because it gets a 500
when fetching /openapi.json
[2024-05-20 13:14:29 -0500] [15108] [INFO] 127.0.0.1:58178 GET /docs 1.1 200 660 0
[2024-05-20 13:14:29 -0500] [15108] [INFO] 127.0.0.1:58178 GET /docs 1.1 - - 0
[2024-05-20 13:14:29,153] ERROR in app: Exception on request GET /openapi.json
Traceback (most recent call last):
File "...\Lib\site-packages\quart\app.py", line 1403, in handle_request
return await self.full_dispatch_request(request_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\quart\app.py", line 1441, in full_dispatch_request
result = await self.handle_user_exception(error)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\quart\app.py", line 1029, in handle_user_exception
raise error
File "...\Lib\site-packages\quart\app.py", line 1439, in full_dispatch_request
result = await self.dispatch_request(request_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\quart\app.py", line 1535, in dispatch_request
return await self.ensure_async(handler)(**request_.view_args) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\quart_schema\extension.py", line 321, in openapi
return jsonify(_build_openapi_schema(current_app, self))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\quart_schema\extension.py", line 657, in _build_openapi_schema
built_paths, components = _build_path(func, rule, app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\Lib\site-packages\quart_schema\extension.py", line 490, in _build_path
schema = model_schema(
^^^^^^^^^^^^^
File "...\Lib\site-packages\quart_schema\conversion.py", line 209, in model_schema
return TypeAdapter(model_class).json_schema(ref_template=PYDANTIC_REF_TEMPLATE)
^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: TypeAdapter() takes no arguments
[2024-05-20 13:14:29 -0500] [15108] [INFO] 127.0.0.1:58178 GET /openapi.json 1.1 500 265 1999
[2024-05-20 13:14:29 -0500] [15108] [INFO] 127.0.0.1:58178 GET /openapi.json 1.1 - - 3001
Using quart-schema[msgspec]
didn't make a difference.
Figured out the issue on the windows side, will confirm if I did the same thing on mac.
Should be fixed in 00a596b698e86473d0266b7674e13ea78332620d (a temporary fix is to install attrs). Now released in 0.20.0
Should be fixed in 00a596b (a temporary fix is to install attrs). Now released in 0.20.0
Hell yeah, that did it. Thanks!
OS: Windows & Mac Python Version: 3.12.3 Packages:
Issue:
Any time I use the method
POST
orPUT
it results in a 400. I have been searching for 2 days for any way to gather more information or get past this, but I am officially stuck now.Removing the wrappers and argument definitions works like normal.
Test
Post
Put
Get
Client Logs
POST
PUT
Get
Server Logs
export QUART_APP="schema:app" && quart run
Recreation
Shell
Code
schema.py