I've recently been acquainted with Connexion when I started working on Swagger. As mentioned in the title, I have an api (called "post_users()" for example) that handles both PUT and POST calls, which I think is commonly done. Since the operationId in the swagger.yaml is supposed to be unique, I was wondering how I can tell connexion to use the same function for both the calls. Sorry, if this was previously asked or if this is a noob question (I am), but I could not find any way to get around this. Thanks, in advance.
one workaround would be to write a function which only calls the other function.
def post_function(data):
do_stuff_here_with(data)
def put_function(data):
return post_function(data)
and specify those two respectively in the swagger file.
Even simpler, you can also just create a variable pointing to the same function:
```python
def post_function(data)
# my code here
....
put_function = post_function
Most helpful comment
one workaround would be to write a function which only calls the other function.
and specify those two respectively in the swagger file.