utoipa icon indicating copy to clipboard operation
utoipa copied to clipboard

Response body Any

Open kellpossible opened this issue 2 years ago • 2 comments

It looks like setting the response body to Any doesn't work as expected, it tries to reference it as a component.

responses(
    (status = 200, body = Any)
)

kellpossible avatar Jun 27 '22 10:06 kellpossible

True, Any as a response body or request body does nothing at the moment. It only works in value_type. Probably the support could be enhanced

juhaku avatar Jul 01 '22 14:07 juhaku

@kellpossible With this I'm thinking should we ignore the type specific parsing implementation which is used for response body and request body and some other thing if not mistaken. And instead use the one that is used for value_type?

This would allow users to define the type for reponses as a Rust type itself which might be a double edged sword. While it would give users a freedom when defining the types, it same time allows users to define "invalid" types what will render as broken OpenAPI specificaiton when viewing.

juhaku avatar Jul 04 '22 22:07 juhaku

Support for recognizing body = Object should become available with the #408.

juhaku avatar Dec 11 '22 15:12 juhaku