connexion.problem

This module contains a Python interface for Problem Details for HTTP APIs <https://tools.ietf.org/html/draft-ietf-appsawg-http-problem-00>, which is a standardized format to communicate distinct “problem types” to non-human consumers.

Module Contents

Functions

problem(status, title, detail, type=None, instance=None, headers=None, ext=None)

Returns a Problem Details error response.

connexion.problem.problem(status, title, detail, type=None, instance=None, headers=None, ext=None)

Returns a Problem Details error response.

Parameters
  • status (int) – The HTTP status code generated by the origin server for this occurrence of the problem.

  • title (str) – A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localisation.

  • detail (str) – An human readable explanation specific to this occurrence of the problem.

  • type – An absolute URI that identifies the problem type. When dereferenced, it SHOULD provide human-readable documentation for the problem type (e.g., using HTML). When this member is not present its value is assumed to be “about:blank”.

  • instance (str) – An absolute URI that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.

  • headers (dict | None) – HTTP headers to include in the response

  • ext (dict | None) – Extension members to include in the body

Type

type: str

Returns

error response

Return type

ConnexionResponse