Skip to content

Commit a35bcf9

Browse files
Remove minLength validation for the secondEmail attribute from the OpenAPI spec. (#520)
fix: Remove minLength constraint from UserProfile.secondEmail to allow empty strings The Okta API returns empty strings ("") for users without a secondary email, but the secondEmail field had a minLength: 5 constraint that caused Pydantic validation to fail during deserialization of valid API responses. Changes: - openapi/api.yaml: Remove minLength: 5 from UserProfile.secondEmail - okta/models/user_profile.py: Remove min_length=5 from second_email field The upstream OpenAPI spec fix was approved and merged. This aligns the SDK with the corrected spec. Testing: Verified on live org by fetching a user with secondEmail set to "" (empty string). The user deserializes successfully without validation errors. Fixes: OKTA-1146937 Refs: #477, #481
1 parent 69fb43b commit a35bcf9

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

okta/models/user_profile.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,7 @@ class UserProfile(BaseModel):
188188
"https://datatracker.ietf.org/doc/html/rfc1808).",
189189
alias="profileUrl",
190190
)
191-
second_email: Optional[
192-
Annotated[str, Field(min_length=5, strict=True, max_length=100)]
193-
] = Field(
191+
second_email: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(
194192
default=None,
195193
description="The secondary email address of the user typically used for account recovery. For validation, "
196194
"see [RFC 5322 Section 3.2.3](https://datatracker.ietf.org/doc/html/rfc5322#section-3.2.3).",

openapi/api.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82223,7 +82223,6 @@ components:
8222382223
type: string
8222482224
format: email
8222582225
description: The secondary email address of the user typically used for account recovery. For validation, see [RFC 5322 Section 3.2.3](https://datatracker.ietf.org/doc/html/rfc5322#section-3.2.3).
82226-
minLength: 5
8222782226
maxLength: 100
8222882227
nullable: true
8222982228
state:

0 commit comments

Comments
 (0)