connexion.resolver

This module contains resolvers, functions that resolves the user defined view functions from the operations defined in the OpenAPI spec.

Module Contents

Classes

Resolution

Resolver

RestyResolver

Resolves endpoint functions using REST semantics (unless overridden by specifying operationId)

MethodViewResolver

Resolves endpoint functions based on Flask’s MethodView semantics, e.g.

Attributes

logger

connexion.resolver.logger
class connexion.resolver.Resolution(function, operation_id)
class connexion.resolver.Resolver(function_resolver=utils.get_function_from_name)
resolve(self, operation)

Default operation resolver

resolve_operation_id(self, operation)

Default operationId resolver

resolve_function_from_operation_id(self, operation_id)

Invokes the function_resolver

class connexion.resolver.RestyResolver(default_module_name, collection_endpoint_name='search')

Bases: Resolver

Resolves endpoint functions using REST semantics (unless overridden by specifying operationId)

resolve_operation_id(self, operation)

Resolves the operationId using REST semantics unless explicitly configured in the spec

resolve_operation_id_using_rest_semantics(self, operation)

Resolves the operationId using REST semantics

resolve(self, operation)

Default operation resolver

resolve_function_from_operation_id(self, operation_id)

Invokes the function_resolver

class connexion.resolver.MethodViewResolver(*args, **kwargs)

Bases: RestyResolver

Resolves endpoint functions based on Flask’s MethodView semantics, e.g.

paths:
/foo_bar:
get:

# Implied function call: api.FooBarView().get

class FooBarView(MethodView):
def get(self):

return …

def post(self):

return …

resolve_operation_id(self, operation)

Resolves the operationId using REST semantics unless explicitly configured in the spec Once resolved with REST semantics the view_name is capitalised and has ‘View’ added to it so it now matches the Class names of the MethodView

resolve_function_from_operation_id(self, operation_id)

Invokes the function_resolver

resolve_operation_id_using_rest_semantics(self, operation)

Resolves the operationId using REST semantics

resolve(self, operation)

Default operation resolver