Okapi Response macro crate
A single macro for creating response code based on responses structs for cases in which it would be ok to avoid implementing OkapiRocketResponseInner manually.
Make strongly typed Rocket responses while simultaneously adding to your openapi.json definitions.
Usage
Example 1
Uses three different structs that you could potentially return at an endpoint.
Also, the last bit of the macro pattern -> (500,501) indicates the responses that will be of type string.
It is not required for your business requirements, but it is for this macro.
You would need to respond an empty tuple -> ().
Note: usage requires the "paste" crate to be imported.
use get;
use openapi;
use JsonSchema;
use ;
use okapi_rocket_response;
use paste;
use Json;
okapi_rocket_response!;
/// Creates documentation for OpenApi
It combines your struct names into a single Enum followed by R to indicate a valid Rocket Response.