pub trait OpenApiResponderInner {
    fn responses(gen: &mut OpenApiGenerator) -> Result<Responses>;
}
Expand description

Implementing this trait means that any route returning the implementer can be marked with #[openapi], and that the route can be documented.

Required Methods

Create the responses type, which is a list of responses that can be rendered in openapi.json format.

Implementations on Foreign Types

Debug prints the internal value before forwarding to the 500 error catcher.

ByteStream is a (potentially infinite) responder. The response Content-Type is set to Binary. The body is unsized, and values are sent as soon as they are yielded by the internal iterator.

ReaderStream is a (potentially infinite) responder. No Content-Type is set. The body is unsized, and values are sent as soon as they are yielded by the internal iterator.

TextStream is a (potentially infinite) responder. The response Content-Type is set to Text. The body is unsized, and values are sent as soon as they are yielded by the internal iterator.

EventStream is a (potentially infinite) responder. The response Content-Type is set to EventStream. The body is unsized, and values are sent as soon as they are yielded by the internal iterator.

Serializes the wrapped value into JSON. Returns a response with Content-Type JSON and a fixed-size body with the serialized value. If serialization fails, an Err of Status::InternalServerError is returned.

Implementors