#rocket #schema-definition #content #responder #okapi #struct #optional

rocket-no-content

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

5 releases

0.1.4 Sep 29, 2024
0.1.3 Sep 22, 2024
0.1.2 Sep 22, 2024
0.1.1 Sep 22, 2024
0.1.0 Sep 22, 2024

#860 in Database interfaces

Download history 202/week @ 2024-09-18 165/week @ 2024-09-25 25/week @ 2024-10-02 6/week @ 2024-10-09

248 downloads per month

MIT license

4KB

rocket-no-content

rocket-no-content 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-no-content::EmptyResponse;

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

Dependencies

~15–47MB
~792K SLoC