You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-15
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ if __name__ == "__main__":
38
38
## Usage
39
39
To validate parameters with flask-parameter-validation, two conditions must be met.
40
40
1. The `@ValidateParameters()` decorator must be applied to the function
41
-
2. Type hints ([supported types](#type-hints-and-accepted-input-types)) and a default of a subclass of `Parameter` must be supplied per parameter flask-parameter-validation parameter
41
+
2. Type hints ([supported types](#type-hints-and-accepted-input-types)) and a default of a subclass of `Parameter` must be supplied per parameter
42
42
43
43
44
44
### Enable and customize Validation for a Route with the @ValidateParameters decorator
@@ -108,20 +108,20 @@ Note: "**POST Methods**" refers to the HTTP methods that send data in the reques
108
108
#### Type Hints and Accepted Input Types
109
109
Type Hints allow for inline specification of the input type of a parameter. Some types are only available to certain `Parameter` subclasses.
110
110
111
-
| Type Hint / Expected Python Type | Notes |`Route`|`Form`|`Json`|`Query`|`File`|
|`list`/`typing.List` (`typing.List` is [deprecated](https://docs.python.org/3/library/typing.html#typing.List)) | For `Query` and `Form` inputs, users can pass via either `value=1&value=2&value=3`, or `value=1,2,3`, both will be transformed to a `list`.| N | Y | Y | Y | N |
118
-
|`typing.Union`| Cannot be used inside of `typing.List`| Y | Y | Y | Y | N |
119
-
|`typing.Optional`|| Y | Y | Y | Y | Y |
120
-
|`datetime.datetime`| Received as a `str` in ISO-8601 date-time format | Y | Y | Y | Y | N |
121
-
|`datetime.date`| Received as a `str` in ISO-8601 full-date format | Y | Y | Y | Y | N |
122
-
|`datetime.time`| Received as a `str` in ISO-8601 partial-time format | Y | Y | Y | Y | N |
123
-
|`dict`| For `Query` and `Form` inputs, users should pass the stringified JSON | N | Y | Y | Y | N |
124
-
|`FileStorage`|| N | N | N | N | Y |
111
+
| Type Hint / Expected Python Type | Notes |`Route`|`Form`|`Json`|`Query`|`File`|
|`list`/`typing.List` (`typing.List` is [deprecated](https://docs.python.org/3/library/typing.html#typing.List)) | For `Query` and `Form` inputs, users can pass via either `value=1&value=2&value=3`, or `value=1,2,3`, both will be transformed to a `list`| N | Y | Y | Y | N |
118
+
|`typing.Union`| Cannot be used inside of `typing.List`| Y | Y | Y | Y | N |
119
+
|`typing.Optional`|| Y | Y | Y | Y | Y |
120
+
|`datetime.datetime`| Received as a `str` in ISO-8601 date-time format | Y | Y | Y | Y | N |
121
+
|`datetime.date`| Received as a `str` in ISO-8601 full-date format | Y | Y | Y | Y | N |
122
+
|`datetime.time`| Received as a `str` in ISO-8601 partial-time format | Y | Y | Y | Y | N |
123
+
|`dict`| For `Query` and `Form` inputs, users should pass the stringified JSON | N | Y | Y | Y | N |
124
+
|`FileStorage`|| N | N | N | N | Y |
125
125
126
126
These can be used in tandem to describe a parameter to validate: `parameter_name: type_hint = ParameterSubclass()`
127
127
-`parameter_name`: The field name itself, such as username
0 commit comments