(sequence_type)
| 5282 | |
| 5283 | @pytest.mark.parametrize(('sequence_type',), [pytest.param(list), pytest.param(Sequence)]) |
| 5284 | def test_sequences_int_json_schema(sequence_type): |
| 5285 | class Model(BaseModel): |
| 5286 | int_seq: sequence_type[int] |
| 5287 | |
| 5288 | assert Model.model_json_schema() == { |
| 5289 | 'title': 'Model', |
| 5290 | 'type': 'object', |
| 5291 | 'properties': { |
| 5292 | 'int_seq': { |
| 5293 | 'title': 'Int Seq', |
| 5294 | 'type': 'array', |
| 5295 | 'items': {'type': 'integer'}, |
| 5296 | }, |
| 5297 | }, |
| 5298 | 'required': ['int_seq'], |
| 5299 | } |
| 5300 | assert Model.model_validate_json('{"int_seq": [1, 2, 3]}') |
| 5301 | |
| 5302 | |
| 5303 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected