Expand description
Assorted function that are used throughout the application.
Functions§
- add_
content_ response - Adds a
Responseto aResponsesobject with the given status code, Content-Type andMediaType. - add_
default_ response_ code - Add
defaultresponse, for when status code is defined at runtime. https://spec.openapis.org/oas/v3.0.0#fixed-fields-13 - add_
default_ response_ schema - Add
defaultresponse with a Schema, for when status code is defined at runtime. https://spec.openapis.org/oas/v3.0.0#fixed-fields-13 - add_
media_ type - Adds the
mediato the given map. If the map already contains aMediaTypewith the given Content-Type, then it will be combined withmedia. - add_
schema_ response - Adds a
Responseto aResponsesobject with the given status code, Content-Type andSchemaObject. - change_
all_ responses_ to_ default - Change all responses in the map to “default” response code. In case of doubles the first items will be reserved.
- ensure_
status_ code_ exists - Checks if the provided
statuscode is in theresponses.responsesfield. 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
Responsesstruct, and sets the status code to the status code provided for each response in theResponses.