Skip to content

How to document parameters defined implicitly? #208

Answered by greyli
lfoppiano asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, I'm glad you like it.

I would recommend defining these parameters as an input schema (with query location):

class RecordQueryInput(Schema):
    type = fields.String(load_default='automatic')
    # ...

@bp.route("/records", methods=["GET"])
@input(RecordQueryInput, location='query')   # <-
@output(Record(many=True))
def get_records_from_form_data(query_data):
    # type = query_data['type']
    return get_records(**query_data)

Let me know if it works, not tested yet.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@lfoppiano
Comment options

@lfoppiano
Comment options

@greyli
Comment options

Answer selected by lfoppiano
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants