Maillol / aiohttp-pydantic

Aiohttp View that validates request body and query sting regarding the annotations declared in the View method
MIT License
67 stars 21 forks source link

Reloading the Swagger UI page breaks it #8

Closed drderuiter closed 3 years ago

drderuiter commented 3 years ago

Steps to reproduce:

Observed behavior:

The steps above lead to the following error: Could not resolve reference: Could not resolve pointer: /components/schemas/Friend does not exist in document Nested schemas, such as Friend in the demo, can not be loaded after the refresh. The outer schemas (Pet in the demo) are loaded fine. I observe the same behavior in my own project using aiohttp-pydantic.

Tested with Python 3.8.5. Emptying the browser cache does not help.

slmtpz commented 3 years ago

I am able to reproduce it both on my own project that uses aiohttp-pydantic and the demo. I can confirm this. I tried with Python 3.8.7 and 3.9.1.

This also happens if you close the Swagger page and reopen it later. Kinda same thing with page refresh/reload.

Maillol commented 3 years ago

After reload page the "components" part of schema is not re-generated.

http://127.0.0.1:8080/oas/spec

Maillol commented 3 years ago

Fixed in the release 1.7.2

https://pypi.org/project/aiohttp-pydantic/1.7.2/

Thanks