Module rocket_okapi::util
source · [−]Expand description
Assorted function that are used throughout the application.
Functions
Adds a Response
to a Responses
object with the given status code, Content-Type and MediaType
.
Add default
response, for when status code is defined at runtime.
https://spec.openapis.org/oas/v3.0.0#fixed-fields-13
Add default
response with a Schema, for when status code is defined at runtime.
https://spec.openapis.org/oas/v3.0.0#fixed-fields-13
Adds the media
to the given map. If the map already contains a MediaType
with the given
Content-Type, then it will be combined with media
.
Adds a Response
to a Responses
object with the given status code, Content-Type and SchemaObject
.
Change all responses in the map to “default” response code. In case of doubles the first items will be reserved.
Checks if the provided status
code is in the responses.responses
field. If it isn’t, inserts
it.
Merges the the two given Responses
.
Replaces the Content-Type for all responses with content_type
.
Takes a Responses
struct, and sets the status code to the status code provided for each
response in the Responses
.