Issue Content
The following code doesn't generate the correct OpenAPI json:
from __future__ import annotations
from dataclasses import dataclass
from typing import Annotated
from fastapi import Depends, FastAPI
app = FastAPI()
def get_potato() -> Potato:
return Potato(color='red', size=10)
@app.get('/')
async def read_root(potato: Annotated[Potato, Depends(get_potato)]):
return {'Hello': 'World'}
@dataclass
class Potato:
color: str
size: int
If we move the Potato up, or remove the Annotated, then it works as expected.
Issue Content
The following code doesn't generate the correct OpenAPI json:
If we move the
Potatoup, or remove theAnnotated, then it works as expected.