Skip to content

Commit

Permalink
Don't let openapi_spec_validator tamper raw spec
Browse files Browse the repository at this point in the history
  • Loading branch information
cziebuhr committed Nov 8, 2018
1 parent fdac627 commit 232aba5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions connexion/apis/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def base_path(self, base_path):
def _validate_spec(self):
from openapi_spec_validator import validate_v2_spec as validate_spec
try:
validate_spec(self._raw_spec)
validate_spec(copy.deepcopy(self._raw_spec))
except OpenAPIValidationError as e:
raise InvalidSpecification.create_from(e)

Expand All @@ -201,7 +201,7 @@ def components(self):
def _validate_spec(self):
from openapi_spec_validator import validate_v3_spec as validate_spec
try:
validate_spec(self._raw_spec)
validate_spec(copy.deepcopy(self._raw_spec))
except OpenAPIValidationError as e:
raise InvalidSpecification.create_from(e)

Expand Down

0 comments on commit 232aba5

Please sign in to comment.