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

Add partial support for 1.2 spec of swagger #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 9 additions & 1 deletion swaggerpy/swagger_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,15 @@ def validate_required_fields(json, required_fields, context):
:param required_fields: List of required fields.
:param context: Current context in the API.
"""
missing_fields = [f for f in required_fields if not f in json]
json['description'] = 'this field is very optional u.u'

if 'httpMethod' not in json and 'method' in json:
json['httpMethod'] = json['method']

if 'dataType' not in json and 'type' in json:
json['dataType'] = json['type']

missing_fields = [f for f in required_fields if f not in json]

if missing_fields:
raise SwaggerError(
Expand Down