0002-misc-add-long_description-for-POST-endpoints-37479.patch
passerelle/templates/passerelle/manage/service_view.html | ||
---|---|---|
76 | 76 |
{% endfor %} |
77 | 77 |
</ul> |
78 | 78 |
{% endif %} |
79 |
{% if endpoint.long_description %} |
|
80 |
<div class="long-description"> |
|
81 |
{{ endpoint.long_description }} |
|
82 |
</div> |
|
83 |
{% endif %} |
|
79 | 84 |
</li> |
80 | 85 |
{% endfor %} |
81 | 86 |
</ul> |
passerelle/utils/api.py | ||
---|---|---|
120 | 120 |
def description(self): |
121 | 121 |
return self.descriptions.get(self.http_method) |
122 | 122 | |
123 |
@property |
|
124 |
def long_description(self): |
|
125 |
return self.http_method == 'post' and self.post and self.post.get('long_description') |
|
126 | ||
123 | 127 |
def get_params(self): |
124 | 128 |
params = [] |
125 | 129 |
defaults = dict(zip( |
passerelle/views.py | ||
---|---|---|
337 | 337 |
raise InvalidParameterValue(parameter) |
338 | 338 | |
339 | 339 |
if request.method == 'POST' and self.endpoint.endpoint_info.post: |
340 |
request_body = self.endpoint.endpoint_info.post.get('request_body') |
|
340 |
request_body = self.endpoint.endpoint_info.post.get('request_body', {})
|
|
341 | 341 |
if 'application/json' in request_body.get('schema', {}): |
342 | 342 |
json_schema = request_body['schema']['application/json'] |
343 | 343 |
try: |
344 |
- |