coding-kitties / flask-swagger-generator

A simple to use flask swagger generator working with the Flask web framework.
MIT License
6 stars 6 forks source link

Issue#21 : New Feature - Added support for query parameters #31

Closed fizaashraf37 closed 1 year ago

fizaashraf37 commented 1 year ago

Issue#21

User can now add query parameters along with path parameters.

Example:

query_parameters =  [
        {
            "name":"param1",
            "type":"string",
        },
        {
            "name":"param2",
            "type":"int",
        }
    ]

@generator.query_parameters(query_parameters)
@blueprint.route('/objects/<int:id>/<string:name>')
def get_object(name):
    return jsonify({'id': 1, 'name': 'test_object_name'}), 201

This will add 2 path parameters id and name to the path and two query parameters param1 and param2

MDUYN commented 1 year ago

Thanks for all the PR's, I will review them all!