Ge0rg3 / flask-parameter-validation

Get and validate all Flask input parameters with ease.
https://pypi.org/project/Flask-Parameter-Validation/
29 stars 12 forks source link

Add MultiSource Parameter Type #49

Closed smt5541 closed 3 months ago

smt5541 commented 4 months ago

🛠 Changes being made

Give examples of the changes you've made in this pull request. Include an itemized list if you can.

🧠 Rationale behind the change

Why did you choose to make these changes?

Does this pull request resolve any open issues?

Yes. Closes #43

Were there any trade-offs you had to consider?

Usage syntax and behavior customization:

string: str = MultiSource(Query, Json, min_int=0) - can't specify validation conditions per parameter type, but it's easier to write out string: str = MultiSource([Query(min_int=0), Json(min_int=0) - could allow for more customization in usage, but for the average user it's a worse experience

🧪 Testing

If the changes aren't backwards compatible, what other options were explored?

✨ Quality check

💬 Additional comments

Feel free to add any further information below

Dependent on #45

Ge0rg3 commented 3 months ago

Great addition, many thanks