Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy spec before validation occurs #215

Merged
merged 2 commits into from
Apr 22, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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