#content #schema #rocket #responder #empty #empty-response #okapi

rocket_empty

Provides a 204 No Content responder for Rocket. Includes optional schema definition.

2 releases

0.1.1 Jan 18, 2023
0.1.0 Jan 18, 2023

#2557 in Database interfaces

Download history 12/week @ 2023-12-11 28/week @ 2023-12-18 18/week @ 2023-12-25 2/week @ 2024-01-01 5/week @ 2024-01-08 28/week @ 2024-01-15 1/week @ 2024-01-29 44/week @ 2024-02-05 22/week @ 2024-02-12 48/week @ 2024-02-19 44/week @ 2024-02-26 64/week @ 2024-03-04 51/week @ 2024-03-11 41/week @ 2024-03-18 26/week @ 2024-03-25

184 downloads per month
Used in rocket_authifier

MIT license

4KB

rocket_empty

rocket_empty provides a singular struct EmptyResponse which has a Responder implementation that returns "204 No Content". In addition to this, it also implements a schema for okapi.

I got tired of copying the same struct and implementation between projects, so here it is.

Usage

use rocket_empty::EmptyResponse;

#[openapi(tag = "Tagged")]
#[get("/test")]
pub async fn test() -> EmptyResponse {
    EmptyResponse
    // Responds with "204 No Content"
}

Dependencies

~15–52MB
~825K SLoC