Skip to content

One to many relationship doesn't return the many #600

Discussion options

You must be logged in to vote

Solved it. The issues was not in the schema definition but in the return type of the route:

@app.get("/api/theme")
def get_theme(session: Session = Depends(get_session)) -> List[ThemeOutput]:
    query = select(Theme)
    return session.exec(query).all()

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by danielmarkow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
1 participant