#content #schema #rocket #responder #empty #okapi #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

#1315 in Database interfaces

Download history 34/week @ 2024-11-13 67/week @ 2024-11-20 97/week @ 2024-11-27 57/week @ 2024-12-04 118/week @ 2024-12-11 94/week @ 2024-12-18 30/week @ 2024-12-25 22/week @ 2025-01-01 46/week @ 2025-01-08 74/week @ 2025-01-15 53/week @ 2025-01-22 36/week @ 2025-01-29 88/week @ 2025-02-05 129/week @ 2025-02-12 73/week @ 2025-02-19 84/week @ 2025-02-26

383 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

~16–50MB
~776K SLoC