I have a handmade REST API that I would like to retrofit to use Openapi 3.0.0
One of my (hand-made Python/Flask) endpoints supports both GET and POST methods in one shot:
@app.route('/search', methods=['POST','GET'])
def searchDevices():
if request.method == 'GET':
brand = request.args.get('brand')
model = request.args.get('model')
capas = request.args.get('capabilities')
elif request.method == 'POST':
brand = request.form.get('brand')
model = request.form.get('model')
capas = request.form.get('capabilities')
Is there a way to model this in Openapi 3.0.0? Right now I understand that I'll need to define to separate YAML end-points with a lot of repetions (bye-bye, DRY), but maybe I am missing something. It would be cool if I could do something like:
paths:
/search:
parameters:
- schema:
:
get, post:
but alas this doesn't seem to work at the moment.