8000 Treat action='' as 'get' · AndreLobato/python-openapi-codec@d63aa44 · GitHub
[go: up one dir, main page]

Skip to content

Commit d63aa44

Browse files
committed
Treat action='' as 'get'
1 parent ff8edb6 commit d63aa44

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openapi_codec/encode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ def _get_paths_object(document):
3232
if link.url not in paths:
3333
paths[link.url] = {}
3434

35+
method = link.action.lower() or 'get'
3536
operation = _get_operation(tag, link)
36-
paths[link.url].update({link.action: operation})
37+
paths[link.url].update({method: operation})
3738

3839
return paths
3940

@@ -46,7 +47,6 @@ def _get_operation(tag, link):
4647
'parameters': _get_parameters(link.fields)
4748
}
4849

49-
5050
def _get_parameters(fields):
5151
"""
5252
Generates Swagger Parameter Item object.

0 commit comments

Comments
 (0)
0