[][src]Module rocket_okapi::util

Assorted function that are used throughout the application.

Functions

add_content_response

Adds a Response to a Responses object with the given status code, Content-Type and MediaType.

add_media_type

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.

add_schema_response

Adds a Response to a Responses object with the given status code, Content-Type and SchemaObject.

ensure_status_code_exists

Checks if the provided status code is in the responses.responses field. If it isn't, inserts it.

produce_any_responses

Merges the the two given Responses.

set_content_type

Replaces the Content-Type for all responses with content_type.

set_status_code

Takes a Responses struct, and sets the status code to the status code provided for each response in the Responses.