Skip to content

Commit

Permalink
remove security objects until upstream encode/django-rest-framework#7516
Browse files Browse the repository at this point in the history
 is merged
  • Loading branch information
n2ygk committed Oct 14, 2020
1 parent 3840074 commit 572ed27
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions rest_framework_json_api/schemas/openapi.py
Expand Up @@ -293,7 +293,6 @@ def get_schema(self, request=None, public=False):
schema = super().get_schema(request, public)

components_schemas = {}
security_schemes_schemas = {}

# Iterate endpoints generating per method path operations.
paths = {}
Expand Down Expand Up @@ -332,19 +331,6 @@ def get_schema(self, request=None, public=False):

components_schemas.update(components)

if hasattr(view.schema, 'get_security_schemes'): # pragma: no cover
security_schemes = view.schema.get_security_schemes(path, method)
else:
security_schemes = {}
for k in security_schemes.keys(): # pragma: no cover
if k not in security_schemes_schemas:
continue
if security_schemes_schemas[k] == security_schemes[k]:
continue
warnings.warn('Securit scheme component "{}" has been overriden with a different '
'value.'.format(k))
security_schemes_schemas.update(security_schemes) # pragma: no cover

if hasattr(view, 'action'):
view.action = current_action
# Normalise path for any provided mount url.
Expand All @@ -361,8 +347,6 @@ def get_schema(self, request=None, public=False):
schema['paths'] = paths
schema['components'] = self.jsonapi_components
schema['components']['schemas'].update(components_schemas)
if len(security_schemes_schemas) > 0: # pragma: no cover
schema['components']['securitySchemes'] = security_schemes_schemas

return schema

Expand Down Expand Up @@ -469,10 +453,6 @@ def get_operation(self, path, method, action=None):
operation = {}
operation['operationId'] = self.get_operation_id(path, method)
operation['description'] = self.get_description(path, method)
if hasattr(self, 'get_security_requirements'): # pragma: no cover
security = self.get_security_requirements(path, method)
if security is not None:
operation['security'] = security

parameters = []
parameters += self.get_path_parameters(path, method)
Expand Down

0 comments on commit 572ed27

Please sign in to comment.