-
Environment:
I cannot create an endpoint that is returning an int (or any other native type)
gives error TypeError: <class 'int'> is invalid I could leave the responses out, but this makes the generated doc incomplete |
Beta Was this translation helpful? Give feedback.
Answered by
dvaerum
Jun 29, 2022
Replies: 3 comments
-
Try to do something like this class ResponseWithInt(BaseModel):
__root__: int other examples: https://github.com/luolingchun/flask-openapi3/blob/master/tests/test_restapi.py#L69-L70 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
luolingchun
This comment has been hidden.
This comment has been hidden.
-
That does indeed solve my question |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try to do something like this
other examples: https://github.com/luolingchun/flask-openapi3/blob/master/tests/test_restapi.py#L69-L70