🐛 Fix OAuth2PasswordRequestForm and OAuth2PasswordRequestFormStrict fixed grant_type "password" RegEx (#9783)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
Co-authored-by: svlandeg <svlandeg@github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
Rahul Pai
2025-01-30 12:17:09 +00:00
committed by GitHub
parent 43d9a4d2b1
commit d5ecbaceae
6 changed files with 57 additions and 30 deletions

View File

@@ -149,7 +149,7 @@ def test_openapi_schema(client: TestClient):
{
"title": "Grant Type",
"anyOf": [
{"pattern": "password", "type": "string"},
{"pattern": "^password$", "type": "string"},
{"type": "null"},
],
}
@@ -158,7 +158,7 @@ def test_openapi_schema(client: TestClient):
# TODO: remove when deprecating Pydantic v1
{
"title": "Grant Type",
"pattern": "password",
"pattern": "^password$",
"type": "string",
}
),

View File

@@ -363,7 +363,7 @@ def test_openapi_schema(mod: ModuleType):
{
"title": "Grant Type",
"anyOf": [
{"pattern": "password", "type": "string"},
{"pattern": "^password$", "type": "string"},
{"type": "null"},
],
}
@@ -372,7 +372,7 @@ def test_openapi_schema(mod: ModuleType):
# TODO: remove when deprecating Pydantic v1
{
"title": "Grant Type",
"pattern": "password",
"pattern": "^password$",
"type": "string",
}
),