Skip to content

Commit ddd9da3

Browse files
authored
✅ Fix new/recent tests with new fixed ValidationError JSON Schema (#4806)
1 parent 197c1d6 commit ddd9da3

File tree

45 files changed

+65
-51
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+65
-51
lines changed

tests/test_generate_unique_id_function.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ def post_router(item1: Item, item2: Item):
217217
"loc": {
218218
"title": "Location",
219219
"type": "array",
220-
"items": {"type": "string"},
220+
"items": {
221+
"anyOf": [{"type": "string"}, {"type": "integer"}]
222+
},
221223
},
222224
"msg": {"title": "Message", "type": "string"},
223225
"type": {"title": "Error Type", "type": "string"},
@@ -416,7 +418,9 @@ def post_router(item1: Item, item2: Item):
416418
"loc": {
417419
"title": "Location",
418420
"type": "array",
419-
"items": {"type": "string"},
421+
"items": {
422+
"anyOf": [{"type": "string"}, {"type": "integer"}]
423+
},
420424
},
421425
"msg": {"title": "Message", "type": "string"},
422426
"type": {"title": "Error Type", "type": "string"},
@@ -615,7 +619,9 @@ def post_router(item1: Item, item2: Item):
615619
"loc": {
616620
"title": "Location",
617621
"type": "array",
618-
"items": {"type": "string"},
622+
"items": {
623+
"anyOf": [{"type": "string"}, {"type": "integer"}]
624+
},
619625
},
620626
"msg": {"title": "Message", "type": "string"},
621627
"type": {"title": "Error Type", "type": "string"},
@@ -887,7 +893,9 @@ def post_subrouter(item1: Item, item2: Item):
887893
"loc": {
888894
"title": "Location",
889895
"type": "array",
890-
"items": {"type": "string"},
896+
"items": {
897+
"anyOf": [{"type": "string"}, {"type": "integer"}]
898+
},
891899
},
892900
"msg": {"title": "Message", "type": "string"},
893901
"type": {"title": "Error Type", "type": "string"},
@@ -1089,7 +1097,9 @@ def post_router(item1: Item, item2: Item):
10891097
"loc": {
10901098
"title": "Location",
10911099
"type": "array",
1092-
"items": {"type": "string"},
1100+
"items": {
1101+
"anyOf": [{"type": "string"}, {"type": "integer"}]
1102+
},
10931103
},
10941104
"msg": {"title": "Message", "type": "string"},
10951105
"type": {"title": "Error Type", "type": "string"},
@@ -1295,7 +1305,9 @@ def post_router(item1: Item, item2: Item):
12951305
"loc": {
12961306
"title": "Location",
12971307
"type": "array",
1298-
"items": {"type": "string"},
1308+
"items": {
1309+
"anyOf": [{"type": "string"}, {"type": "integer"}]
1310+
},
12991311
},
13001312
"msg": {"title": "Message", "type": "string"},
13011313
"type": {"title": "Error Type", "type": "string"},
@@ -1579,7 +1591,9 @@ def post_with_callback(item1: Item, item2: Item):
15791591
"loc": {
15801592
"title": "Location",
15811593
"type": "array",
1582-
"items": {"type": "string"},
1594+
"items": {
1595+
"anyOf": [{"type": "string"}, {"type": "integer"}]
1596+
},
15831597
},
15841598
"msg": {"title": "Message", "type": "string"},
15851599
"type": {"title": "Error Type", "type": "string"},

tests/test_param_include_in_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ async def hidden_query(
149149
"loc": {
150150
"title": "Location",
151151
"type": "array",
152-
"items": {"type": "string"},
152+
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
153153
},
154154
"msg": {"title": "Message", "type": "string"},
155155
"type": {"title": "Error Type", "type": "string"},

tests/test_tuples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def hello(values: Tuple[int, int] = Form(...)):
200200
"loc": {
201201
"title": "Location",
202202
"type": "array",
203-
"items": {"type": "string"},
203+
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
204204
},
205205
"msg": {"title": "Message", "type": "string"},
206206
"type": {"title": "Error Type", "type": "string"},

tests/test_tutorial/test_body/test_tutorial001_py310.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"loc": {
6262
"title": "Location",
6363
"type": "array",
64-
"items": {"type": "string"},
64+
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
6565
},
6666
"msg": {"title": "Message", "type": "string"},
6767
"type": {"title": "Error Type", "type": "string"},

tests/test_tutorial/test_body_fields/test_tutorial001_py310.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"loc": {
8585
"title": "Location",
8686
"type": "array",
87-
"items": {"type": "string"},
87+
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
8888
},
8989
"msg": {"title": "Message", "type": "string"},
9090
"type": {"title": "Error Type", "type": "string"},

tests/test_tutorial/test_body_multiple_params/test_tutorial001_py310.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"loc": {
7878
"title": "Location",
7979
"type": "array",
80-
"items": {"type": "string"},
80+
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
8181
},
8282
"msg": {"title": "Message", "type": "string"},
8383
"type": {"title": "Error Type", "type": "string"},

tests/test_tutorial/test_body_multiple_params/test_tutorial003_py310.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"loc": {
8989
"title": "Location",
9090
"type": "array",
91-
"items": {"type": "string"},
91+
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
9292
},
9393
"msg": {"title": "Message", "type": "string"},
9494
"type": {"title": "Error Type", "type": "string"},

tests/test_tutorial/test_body_nested_models/test_tutorial009_py39.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"loc": {
5353
"title": "Location",
5454
"type": "array",
55-
"items": {"type": "string"},
55+
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
5656
},
5757
"msg": {"title": "Message", "type": "string"},
5858
"type": {"title": "Error Type", "type": "string"},

tests/test_tutorial/test_body_updates/test_tutorial001_py310.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"loc": {
109109
"title": "Location",
110110
"type": "array",
111-
"items": {"type": "string"},
111+
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
112112
},
113113
"msg": {"title": "Message", "type": "string"},
114114
"type": {"title": "Error Type", "type": "string"},

tests/test_tutorial/test_body_updates/test_tutorial001_py39.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"loc": {
109109
"title": "Location",
110110
"type": "array",
111-
"items": {"type": "string"},
111+
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
112112
},
113113
"msg": {"title": "Message", "type": "string"},
114114
"type": {"title": "Error Type", "type": "string"},

0 commit comments

Comments
 (0)