From 3a2ba260164ae17614d1703565efcdb1546b6191 Mon Sep 17 00:00:00 2001 From: Andrew Standley Date: Tue, 17 Sep 2019 11:21:23 -0700 Subject: [PATCH] Fix typos and imports. --- .../swagger_generation/authenticator_to_swagger.py | 8 ++------ flask_rebar/swagger_generation/generator_utils.py | 10 +++++----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/flask_rebar/swagger_generation/authenticator_to_swagger.py b/flask_rebar/swagger_generation/authenticator_to_swagger.py index 5a2974d0..3b58a284 100644 --- a/flask_rebar/swagger_generation/authenticator_to_swagger.py +++ b/flask_rebar/swagger_generation/authenticator_to_swagger.py @@ -1,11 +1,7 @@ from collections import namedtuple from flask_rebar.utils.deprecation import deprecated, deprecated_parameters -from flask_rebar.authenticators import ( - HeaderApiKeyAuthenticator, - USE_DEFAULT, - Authenticator, -) +from flask_rebar.authenticators import HeaderApiKeyAuthenticator, Authenticator from .marshmallow_to_swagger import ConverterRegistry from . import swagger_words as sw @@ -66,7 +62,7 @@ class HeaderApiKeyConverter(AuthenticatorConverter): def get_security_requirements(self, obj, context): """ - :param HeaderApiLeyAuthenticator obj: + :param HeaderApiKeyAuthenticator obj: :param _Context context: :return: list """ diff --git a/flask_rebar/swagger_generation/generator_utils.py b/flask_rebar/swagger_generation/generator_utils.py index 9e474a46..48370031 100644 --- a/flask_rebar/swagger_generation/generator_utils.py +++ b/flask_rebar/swagger_generation/generator_utils.py @@ -12,7 +12,7 @@ from collections import namedtuple, OrderedDict from flask_rebar.utils.deprecation import deprecated -from flask_rebar.authenticators import HeaderApiKeyAuthenticator, USE_DEFAULT +from flask_rebar.utils.defaults import USE_DEFAULT from flask_rebar.swagger_generation import swagger_words as sw from flask_rebar.swagger_generation.marshmallow_to_swagger import get_swagger_title from flask_rebar.swagger_generation.authenticator_to_swagger import ( @@ -20,9 +20,6 @@ ) -AuthenticatorConverter = AuthenticatorConverterRegistry # deprecated alias - - def get_key(obj): """ Returns the key for a JSONSchema object that we can use to make a $ref. @@ -191,7 +188,7 @@ def convert_header_api_key_authenticator(authenticator): """ Converts a HeaderApiKeyAuthenticator object to a Swagger definition. - :param HeaderApiKeyAuthenticator authenticator: + :param flask_rebar.authenticators.HeaderApiKeyAuthenticator authenticator: :rtype: tuple(str, dict) :returns: Tuple where the first item is a name for the authenticator, and the second item is a Swagger definition for it. @@ -305,3 +302,6 @@ def recursively_convert_dict_to_ordered_dict(obj): return [recursively_convert_dict_to_ordered_dict(item) for item in obj] else: return obj + + +AuthenticatorConverter = AuthenticatorConverterRegistry # deprecated alias