Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09a8ede15d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| os_version: Optional[List[StrictStr]] = Field(default=None, description="Case-insensitive prefix filter on the OS version.", alias="osVersion") | ||
| serial_number: Optional[Annotated[List[StrictStr], Field(max_length=50)]] = Field(default=None, description="Case-insensitive prefix filter on the serial number.", alias="serialNumber") | ||
| location_country_iso: Optional[List[StrictStr]] = Field(default=None, description="Filter using the ISO country code of the location. ", alias="locationCountryISO") |
There was a problem hiding this comment.
Apply serial number length constraint to items, not list
The new serial_number type uses Field(max_length=50) on List[StrictStr], which in Pydantic v2 constrains the list length, not each string. That means clients can pass serial numbers longer than 50 characters without validation, while lists with more than 50 serial numbers will be rejected even if each serial is valid. If the API expects a 50‑character limit per serial number (as the description implies), the constraint should be on each item (e.g., List[Annotated[StrictStr, Field(max_length=50)]]). This regression is introduced here and can break callers who supply >50 serials while still letting invalid serial strings through.
Useful? React with 👍 / 👎.
No description provided.