|
| 1 | +<!-- markdownlint-disable MD041 MD043 --> |
| 2 | +Whenever you use OpenAPI parameters to validate [query strings](api_gateway.md#validating-query-strings) or [path parameters](api_gateway.md#validating-path-parameters), you can enhance validation and OpenAPI documentation by using any of these parameters: |
| 3 | + |
| 4 | +| Field name | Type | Description | |
| 5 | +| --------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 6 | +| `alias` | `str` | Alternative name for a field, used when serializing and deserializing data | |
| 7 | +| `validation_alias` | `str` | Alternative name for a field during validation (but not serialization) | |
| 8 | +| `serialization_alias` | `str` | Alternative name for a field during serialization (but not during validation) | |
| 9 | +| `description` | `str` | Human-readable description | |
| 10 | +| `gt` | `float` | Greater than. If set, value must be greater than this. Only applicable to numbers | |
| 11 | +| `ge` | `float` | Greater than or equal. If set, value must be greater than or equal to this. Only applicable to numbers | |
| 12 | +| `lt` | `float` | Less than. If set, value must be less than this. Only applicable to numbers | |
| 13 | +| `le` | `float` | Less than or equal. If set, value must be less than or equal to this. Only applicable to numbers | |
| 14 | +| `min_length` | `int` | Minimum length for strings | |
| 15 | +| `max_length` | `int` | Maximum length for strings | |
| 16 | +| `pattern` | `string` | A regular expression that the string must match. | |
| 17 | +| `strict` | `bool` | If `True`, strict validation is applied to the field. See [Strict Mode](https://docs.pydantic.dev/latest/concepts/strict_mode/){target"_blank" rel="nofollow"} for details | |
| 18 | +| `multiple_of` | `float` | Value must be a multiple of this. Only applicable to numbers | |
| 19 | +| `allow_inf_nan` | `bool` | Allow `inf`, `-inf`, `nan`. Only applicable to numbers | |
| 20 | +| `max_digits` | `int` | Maximum number of allow digits for strings | |
| 21 | +| `decimal_places` | `int` | Maximum number of decimal places allowed for numbers | |
| 22 | +| `examples` | `List\[Any\]` | List of examples of the field | |
| 23 | +| `deprecated` | `bool` | Marks the field as deprecated | |
| 24 | +| `include_in_schema` | `bool` | If `False` the field will not be part of the exported OpenAPI schema | |
| 25 | +| `json_schema_extra` | `JsonDict` | Any additional JSON schema data for the schema property | |
0 commit comments