This repository was archived by the owner on Mar 18, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 88from openapi_codec .decode import _parse_document
99
1010
11- __version__ = '1.1.3 '
11+ __version__ = '1.1.4 '
1212
1313
1414class OpenAPICodec (BaseCodec ):
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ def _get_paths_object(document):
6666
6767 for operation_id , link , tags in links :
6868 if link .url not in paths :
69- paths [link .url ] = {}
69+ paths [link .url ] = OrderedDict ()
7070
7171 method = get_method (link )
7272 operation = _get_operation (operation_id , link , tags )
@@ -77,13 +77,19 @@ def _get_paths_object(document):
7777
7878def _get_operation (operation_id , link , tags ):
7979 encoding = get_encoding (link )
80+ description = link .description .strip ()
81+ summary = description .splitlines ()[0 ] if description else None
8082
8183 operation = {
8284 'operationId' : operation_id ,
83- 'description' : link .description ,
8485 'responses' : _get_responses (link ),
8586 'parameters' : _get_parameters (link , encoding )
8687 }
88+
89+ if description :
90+ operation ['description' ] = description
91+ if summary :
92+ operation ['summary' ] = summary
8793 if encoding :
8894 operation ['consumes' ] = [encoding ]
8995 if tags :
You can’t perform that action at this time.
0 commit comments