Skip to content

feat(profile): add max_length validation constraint on bio field - #91

Open
emre155 wants to merge 1 commit into
anxkhn:mainfrom
emre155:fix/profile-bio-max-length
Open

feat(profile): add max_length validation constraint on bio field#91
emre155 wants to merge 1 commit into
anxkhn:mainfrom
emre155:fix/profile-bio-max-length

Conversation

@emre155

@emre155 emre155 commented Jul 18, 2026

Copy link
Copy Markdown

Summary

Adds a length validation constraint on the profile bio field to prevent extremely large inputs (megabytes of text) from causing memory and performance issues (closes #13).

Changes

  • Imported Field from pydantic.
  • Configured bio field in ProfileCreate model to use Field(..., max_length=500).
  • Added a test case test_create_profile_with_too_long_bio to tests/test_profile.py that asserts requests exceeding the 500 characters limit return HTTP 422.

Signed-off-by: emreumar emreumar@users.noreply.github.com

Signed-off-by: emreumar <emreumar@users.noreply.github.com>
@emre155
emre155 requested a review from anxkhn as a code owner July 18, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add max_length validation to profile bio field

2 participants