Module Contents




Abstract base class for generic types.


Middleware to check if operation is accessible on scope.


class starlette.types.ASGIApp, *, security_handler_factory:, security: list, security_schemes: dict)
classmethod from_operation(cls, operation: connexion.operations.AbstractOperation, *, next_app: starlette.types.ASGIApp, security_handler_factory: SecurityOperation
async __call__(self, scope: starlette.types.Scope, receive: starlette.types.Receive, send: starlette.types.Send) None
class*args, auth_all_paths: bool = False, **kwargs)

Bases: connexion.middleware.abstract.RoutedAPI[SecurityOperation]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
        return mapping[key]
    except KeyError:
        return default

Base API class with only minimal behavior related to the specification.

  • specification – OpenAPI specification. Can be provided either as dict, or as path to file.

  • base_path – Base path to host the API.

  • resolver – Callable that maps operationID to a function

  • resolver_error_handler – Callable that generates an Operation used for handling ResolveErrors

  • arguments – Jinja arguments to resolve in specification.

  • options – New style options dictionary.

__slots__ = []
add_auth_on_not_found(self) None

Register a default SecurityOperation for routes that are not found.

make_operation(self, operation: connexion.operations.AbstractOperation) SecurityOperation

Create an operation of the operation_cls type.

add_paths(self) None
add_operation(self, path: str, method: str) None
classmethod __class_getitem__(cls, params)
classmethod __init_subclass__(cls, *args, **kwargs)
class starlette.types.ASGIApp)

Bases: connexion.middleware.abstract.RoutedMiddleware[SecurityAPI]

Middleware to check if operation is accessible on scope.

__slots__ = []
add_api(self, specification: Union[pathlib.Path, str, dict], **kwargs) None
async __call__(self, scope: starlette.types.Scope, receive: starlette.types.Receive, send: starlette.types.Send) None

Fetches the operation related to the request and calls it.

classmethod __class_getitem__(cls, params)
classmethod __init_subclass__(cls, *args, **kwargs)
exception, title=None, detail=None, type=None, instance=None, headers=None, ext=None)

Bases: connexion.exceptions.ProblemException

Common base class for all non-exit exceptions.

This exception holds arguments that are going to be passed to the connexion.problem function to generate a proper response.

class __cause__

exception cause

class __context__

exception context

class __suppress_context__
class __traceback__
class args

Implement delattr(self, name).


Default dir() implementation.


Return self==value.


Default object formatter.


Return self>=value.


Return getattr(self, name).


Return self>value.


Return hash(self).


Return self<=value.


Return self<value.


Return self!=value.


Helper for pickle.


Helper for pickle.


Return repr(self).


Implement setattr(self, name, value).


Size of object in memory, in bytes.


Return str(self).


Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).


Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.