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 8
8
from openapi_codec .decode import _parse_document
9
9
10
10
11
- __version__ = '1.1.3 '
11
+ __version__ = '1.1.4 '
12
12
13
13
14
14
class OpenAPICodec (BaseCodec ):
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ def _get_paths_object(document):
66
66
67
67
for operation_id , link , tags in links :
68
68
if link .url not in paths :
69
- paths [link .url ] = {}
69
+ paths [link .url ] = OrderedDict ()
70
70
71
71
method = get_method (link )
72
72
operation = _get_operation (operation_id , link , tags )
@@ -77,13 +77,19 @@ def _get_paths_object(document):
77
77
78
78
def _get_operation (operation_id , link , tags ):
79
79
encoding = get_encoding (link )
80
+ description = link .description .strip ()
81
+ summary = description .splitlines ()[0 ] if description else None
80
82
81
83
operation = {
82
84
'operationId' : operation_id ,
83
- 'description' : link .description ,
84
85
'responses' : _get_responses (link ),
85
86
'parameters' : _get_parameters (link , encoding )
86
87
}
88
+
89
+ if description :
90
+ operation ['description' ] = description
91
+ if summary :
92
+ operation ['summary' ] = summary
87
93
if encoding :
88
94
operation ['consumes' ] = [encoding ]
89
95
if tags :
You can’t perform that action at this time.
0 commit comments