Crate poem_ext

Crate poem_ext 

Source
Expand description

check test codecov Version dependency status

§poem-ext

Extension crate for poem/poem-openapi

Modules§

dbsea-orm
Contains a middleware that automatically creates and manages a sea_orm::DatabaseTransaction for each incoming request. The transaction is automatically commit()ed if the endpoint returns a successful response or rollback()ed in case of an error.
panic_handler
Contains a middlware that automatically responds with an internal server error whenever the current thread is panicking.
patch_value
Contains the PatchValue enum that can be used in PATCH endpoints to distinguish between values that should be updated and those that should remain unchanged.
responses
Improve endpoint documentation by adding response schemas to the OpenAPI spec that might be returned by an authorization dependency, a bad request handler or other middlewares.
shield_mwshield
Contains a middleware that prevents endpoint handlers from being canceled if the connection is closed.

Macros§

add_response_schemas
Implement MetaResponsesExt for a type to add additional response schemas to an endpoint by using the Response type.
custom_auth
Define a custom authorization dependency based on poem_openapi::auth::Bearer that uses a custom function to perform authorization.
response
Construct an ApiResponse enum with some helper functions to easily create both success and error responses.
static_string
Construct an OpenApi type that always evaluates to a static string that is set at compile time.