Skip to content

AAI-289 better validation/error messages for username and password#60

Merged
marius-mather merged 3 commits into
mainfrom
custom-validation
Aug 25, 2025
Merged

AAI-289 better validation/error messages for username and password#60
marius-mather merged 3 commits into
mainfrom
custom-validation

Conversation

@marius-mather

@marius-mather marius-mather commented Aug 25, 2025

Copy link
Copy Markdown
Collaborator

Description

AAI-289: Pydantic's default error messages for string constraints are not very user-friendly, override them so we can provide custom errors that we can send to the frontend.

Changes

  • Create custom types for BiocommonsUsername and BiocommonsPassword so we can set custom error messages for validation
  • Tests of validation and error messages

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have added unit / integration tests that prove my fix is effective or that my feature works
  • I have run all tests locally and they pass
  • I have updated the documentation (if applicable)

How to Test Manually (if necessary)

Run uv run pytest

@amandazhuyilan amandazhuyilan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice error messages!

@marius-mather marius-mather merged commit 912d1a1 into main Aug 25, 2025
2 checks passed
@amandazhuyilan amandazhuyilan deleted the custom-validation branch November 24, 2025 22:23
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.

2 participants