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

rocket_empty

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

3 releases

0.1.2 Oct 21, 2024
0.1.1 Jan 18, 2023
0.1.0 Jan 18, 2023

#965 in Database interfaces

Download history 62/week @ 2024-08-26 42/week @ 2024-09-02 64/week @ 2024-09-09 32/week @ 2024-09-16 77/week @ 2024-09-23 94/week @ 2024-09-30 123/week @ 2024-10-07 69/week @ 2024-10-14 230/week @ 2024-10-21 61/week @ 2024-10-28 55/week @ 2024-11-04 32/week @ 2024-11-11 50/week @ 2024-11-18 111/week @ 2024-11-25 56/week @ 2024-12-02 101/week @ 2024-12-09

321 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–47MB
~794K SLoC