pgjones / quart-schema

Quart-Schema is a Quart extension that provides schema validation and auto-generated API documentation.
MIT License
76 stars 24 forks source link

Fix form multiselect request validation #68

Closed PierrickBrun closed 3 months ago

PierrickBrun commented 9 months ago

When using a FORM Datasource, if a multiselect field is present, quart-schema will fail to validate the data.

This is because MultiDict.to_dict() returns only the first occurrence of each key by default.

By using flat=True this PR fixes this.

ref: https://stackoverflow.com/questions/51992901/capture-values-from-multiple-select-form-and-post-via-flask

https://werkzeug.palletsprojects.com/en/3.0.x/datastructures/#werkzeug.datastructures.MultiDict.to_dict

PierrickBrun commented 7 months ago

Hi @pgjones , any opinion on this PR ? thanks

pgjones commented 3 months ago

Thanks