Skip to content

Commit

Permalink
✅ Fix new/recent tests with new fixed ValidationError JSON Schema
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Apr 17, 2022
1 parent 197c1d6 commit d8976ae
Show file tree
Hide file tree
Showing 45 changed files with 65 additions and 51 deletions.
28 changes: 21 additions & 7 deletions tests/test_generate_unique_id_function.py
Expand Up @@ -217,7 +217,9 @@ def post_router(item1: Item, item2: Item):
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down Expand Up @@ -416,7 +418,9 @@ def post_router(item1: Item, item2: Item):
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down Expand Up @@ -615,7 +619,9 @@ def post_router(item1: Item, item2: Item):
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down Expand Up @@ -887,7 +893,9 @@ def post_subrouter(item1: Item, item2: Item):
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down Expand Up @@ -1089,7 +1097,9 @@ def post_router(item1: Item, item2: Item):
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down Expand Up @@ -1295,7 +1305,9 @@ def post_router(item1: Item, item2: Item):
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down Expand Up @@ -1579,7 +1591,9 @@ def post_with_callback(item1: Item, item2: Item):
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_param_include_in_schema.py
Expand Up @@ -149,7 +149,7 @@ async def hidden_query(
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tuples.py
Expand Up @@ -200,7 +200,7 @@ def hello(values: Tuple[int, int] = Form(...)):
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tutorial/test_body/test_tutorial001_py310.py
Expand Up @@ -61,7 +61,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -84,7 +84,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -77,7 +77,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -88,7 +88,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -52,7 +52,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -108,7 +108,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -108,7 +108,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -48,7 +48,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -102,7 +102,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -60,7 +60,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -87,7 +87,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -77,7 +77,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -147,7 +147,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -48,7 +48,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -71,7 +71,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -71,7 +71,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -66,7 +66,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -57,7 +57,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -52,7 +52,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -52,7 +52,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -53,7 +53,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -53,7 +53,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -51,7 +51,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -106,7 +106,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -107,7 +107,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -120,7 +120,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -119,7 +119,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tutorial/test_request_files/test_tutorial003.py
Expand Up @@ -132,7 +132,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -132,7 +132,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -73,7 +73,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -69,7 +69,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -69,7 +69,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -97,7 +97,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"type": "string"},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down

0 comments on commit d8976ae

Please sign in to comment.