Skip to content

Commit

Permalink
oneOf -> anyOf
Browse files Browse the repository at this point in the history
  • Loading branch information
dconathan committed Aug 31, 2021
1 parent 95ce749 commit 6caac74
Show file tree
Hide file tree
Showing 78 changed files with 79 additions and 79 deletions.
2 changes: 1 addition & 1 deletion fastapi/openapi/utils.py
Expand Up @@ -40,7 +40,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_additional_properties.py
Expand Up @@ -76,7 +76,7 @@ def foo(items: Items):
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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 @@ def main_route(callback_url: HttpUrl):
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_additional_responses_default_validationerror.py
Expand Up @@ -54,7 +54,7 @@ async def a(id):
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_application.py
Expand Up @@ -1101,7 +1101,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_dependency_duplicates.py
Expand Up @@ -177,7 +177,7 @@ async def no_duplicates_sub(
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_extra_routes.py
Expand Up @@ -292,7 +292,7 @@ def trace_item(item_id: str):
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_filter_pydantic_sub_model.py
Expand Up @@ -116,7 +116,7 @@ async def get_model_a(name: str, model_c=Depends(get_model_c)):
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_get_request_body.py
Expand Up @@ -85,7 +85,7 @@ async def create_item(product: Product):
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_include_router_defaults_overrides.py
Expand Up @@ -6606,7 +6606,7 @@ def test_paths_level5(override1, override2, override3, override4, override5):
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_modules_same_name_body/test_main.py
Expand Up @@ -101,7 +101,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_multi_body_errors.py
Expand Up @@ -79,7 +79,7 @@ def save_item_no_body(item: List[Item]):
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_multi_query_errors.py
Expand Up @@ -63,7 +63,7 @@ def read_items(q: List[int] = Query(None)):
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_in_path_and_dependency.py
Expand Up @@ -71,7 +71,7 @@ async def read_users(user_id: int):
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_put_no_body.py
Expand Up @@ -57,7 +57,7 @@ def save_item_no_body(item_id: str):
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_repeated_dependency_schema.py
Expand Up @@ -36,7 +36,7 @@ def get_deps(dep1: str = Depends(get_header), dep2: str = Depends(get_something_
"ValidationError": {
"properties": {
"loc": {
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
"title": "Location",
"type": "array",
},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_schema_extra_examples.py
Expand Up @@ -830,7 +830,7 @@ def cookie_example_examples(
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_security_oauth2.py
Expand Up @@ -117,7 +117,7 @@ def read_current_user(current_user: "User" = Depends(get_current_user)):
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_security_oauth2_optional.py
Expand Up @@ -121,7 +121,7 @@ def read_users_me(current_user: Optional[User] = Depends(get_current_user)):
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_security_oauth2_optional_description.py
Expand Up @@ -122,7 +122,7 @@ def read_users_me(current_user: Optional[User] = Depends(get_current_user)):
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_starlette_exception.py
Expand Up @@ -102,7 +102,7 @@ async def read_starlette_item(item_id: str):
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_sub_callbacks.py
Expand Up @@ -256,7 +256,7 @@ def create_invoice(invoice: Invoice, callback_url: Optional[HttpUrl] = None):
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -76,7 +76,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -72,7 +72,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -75,7 +75,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_bigger_applications/test_main.py
Expand Up @@ -323,7 +323,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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.py
Expand Up @@ -63,7 +63,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_fields/test_tutorial001.py
Expand Up @@ -87,7 +87,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -79,7 +79,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down
Expand Up @@ -90,7 +90,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_updates/test_tutorial001.py
Expand Up @@ -109,7 +109,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_cookie_params/test_tutorial001.py
Expand Up @@ -50,7 +50,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_dataclasses/test_tutorial001.py
Expand Up @@ -71,7 +71,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_dataclasses/test_tutorial003.py
Expand Up @@ -118,7 +118,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_dependencies/test_tutorial001.py
Expand Up @@ -104,7 +104,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_dependencies/test_tutorial004.py
Expand Up @@ -62,7 +62,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_dependencies/test_tutorial006.py
Expand Up @@ -55,7 +55,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"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_dependencies/test_tutorial012.py
Expand Up @@ -102,7 +102,7 @@
"loc": {
"title": "Location",
"type": "array",
"items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},
"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
Expand Down

0 comments on commit 6caac74

Please sign in to comment.