Skip to content

Commit

Permalink
Merge pull request concentricsky#92 from Novarg/swagger-1.2-2.0.22-2.…
Browse files Browse the repository at this point in the history
…0.37

Swagger-ui 2.0.22, swagger.js 2.0.37
  • Loading branch information
johnraz committed Sep 11, 2014
2 parents c991a87 + ca8ffed commit 99189d3
Show file tree
Hide file tree
Showing 25 changed files with 9,289 additions and 5,005 deletions.
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

0 comments on commit 99189d3

Please sign in to comment.