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

Swagger-ui 2.0.22, swagger.js 2.0.37 #92

Merged
merged 5 commits into from
Sep 11, 2014
Merged
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions tastypie_swagger/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def build_parameters_from_extra_action(self, method, fields, resource_type):
description='Primary key of resource'))
for name, field in fields.items():
parameters.append(self.build_parameter(
paramType="query",
paramType=field.get("param_type", "query"),
name=name,
dataType=field.get("type", "string"),
required=field.get("required", True),
Expand Down Expand Up @@ -346,6 +346,7 @@ def build_extra_operation(self, extra_action):
resource_type=extra_action.get("resource_type", "view")),
'responseClass': 'Object', #TODO this should be extended to allow the creation of a custom object.
'nickname': extra_action['name'],
'notes': extra_action.get('notes', ''),
}

def build_detail_api(self):
Expand Down Expand Up @@ -421,8 +422,10 @@ def build_property(self, name, type, description=""):

def build_properties_from_fields(self, method='get'):
properties = {}

excludes = getattr(self.resource._meta, 'excludes', [])
for name, field in self.schema['fields'].items():
if name in excludes:
continue
# Exclude fields from custom put / post object definition
if method in ['post','put']:
if name in self.WRITE_ACTION_IGNORED_FIELDS:
Expand Down
File renamed without changes.
Loading