Skip to content

Commit 9082dbe

Browse files
authored
fix: Prevent request validation errors from appearing as a duplicate of internal validation errors in swagger docs. (#34)
closes #33
1 parent 73626c6 commit 9082dbe

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/fastapi_problem/handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def wrapper() -> dict:
9494
"errors",
9595
"status",
9696
],
97-
"title": "ValidationError",
97+
"title": "RequestValidationError",
9898
}
9999
problem = {
100100
"properties": {

tests/test_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ async def status(_a: str) -> dict:
541541
"errors",
542542
"status",
543543
],
544-
"title": "ValidationError",
544+
"title": "RequestValidationError",
545545
}
546546
assert "Problem" in res["components"]["schemas"]
547547
assert "ValidationError" in res["components"]["schemas"]
@@ -651,7 +651,7 @@ async def status(_a: str) -> dict:
651651
"errors",
652652
"status",
653653
],
654-
"title": "ValidationError",
654+
"title": "RequestValidationError",
655655
}
656656
assert "Problem" in res["components"]["schemas"]
657657
assert "ValidationError" in res["components"]["schemas"]

0 commit comments

Comments
 (0)