Version 3.4.1
3.4.1
Changed
- OpenAPI now if no
description
is provided from the handlers, it will read directly from
the docstrings. - Internal code cleaning and organisation.
Fixed
- OpenAPI query parameters were not rendering properly for optional
dict
orlist
types. This
was due to the internal evaluation of theNone
field which is now skipping for OpenAPI purposes.
Example
Now it is possible to do something like this:
from typing import Dict, List, Union, Optional
from esmerald import Gateway, JSONResponse, Query, get
@get("/item")
async def check_item(q: Union[List[str], None]) -> JSONResponse:
return JSONResponse({"value": q})
@get("/another-item")
async def check_item(q: Optional[Dict[str, str]]) -> JSONResponse:
return JSONResponse({"value": q})