Now we have models for Swagger 2.0 and OpenAPI 3.1 specification.
And there is a compatibility layer for internal usage (e.g. when we want to add a route and read parameters from request in a handler)
Since it is forbidden to inherit aiohttp.web.Application and use custom router, I removed old router in favor of Config.
Also we don't generate specification on the fly anymore. Loader returns data as-is.
Handlers with operations described in docstring (if any) must be added to config before Config.setup() call.
TODO:
[x] Add more tests for requestBody
[x] Test aiohttp_jinja2 and return template decorator if required
In future I'd like to add a fastapi-like decorator, which allows to generate specification from code.
There is @operation decorator, but currently it does not affect specification.
It should work like docstrings.
The difference is that we use models from compatibility layer
and it is required to implement a converter to a target specification version.
Finally, Swagger-UI still does not support OpenAPI 3.1. May be we should look for an alternative or an additional UI?
Now we have models for Swagger 2.0 and OpenAPI 3.1 specification. And there is a compatibility layer for internal usage (e.g. when we want to add a route and read parameters from request in a handler)
Since it is forbidden to inherit aiohttp.web.Application and use custom router, I removed old router in favor of Config.
Also we don't generate specification on the fly anymore. Loader returns data as-is. Handlers with operations described in docstring (if any) must be added to config before
Config.setup()
call.TODO:
In future I'd like to add a fastapi-like decorator, which allows to generate specification from code. There is
@operation
decorator, but currently it does not affect specification. It should work like docstrings. The difference is that we use models from compatibility layer and it is required to implement a converter to a target specification version.Finally, Swagger-UI still does not support OpenAPI 3.1. May be we should look for an alternative or an additional UI?