Skip to content

Commit

Permalink
Merge pull request #215 from wasbazi/copy-before-validation
Browse files Browse the repository at this point in the history
Copy spec before validation occurs
  • Loading branch information
rafaelcaricio committed Apr 22, 2016
2 parents eecca74 + 6614d78 commit dd206da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion connexion/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
language governing permissions and limitations under the License.
"""

import copy
import json
import logging
import pathlib
Expand Down Expand Up @@ -87,7 +88,10 @@ def __init__(self, swagger_yaml_path, base_url=None, arguments=None,

logger.debug('Read specification', extra=self.specification)

validate_spec(compatibility_layer(self.specification))
self.specification = compatibility_layer(self.specification)
# Avoid validator having ability to modify specification
spec = copy.deepcopy(self.specification)
validate_spec(spec)

# https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#fixed-fields
# If base_url is not on provided then we try to read it from the swagger.yaml or use / by default
Expand Down

0 comments on commit dd206da

Please sign in to comment.