Skip to content

Forbid extra#49

Draft
rafa-guedes wants to merge 3 commits intomainfrom
forbid-extra
Draft

Forbid extra#49
rafa-guedes wants to merge 3 commits intomainfrom
forbid-extra

Conversation

@rafa-guedes
Copy link
Contributor

Add strict validation to Pydantic models (extra="forbid")

Introduces StrictBaseModel with extra="forbid" configuration and migrates all Pydantic models to inherit from it.

Why: Pydantic's default extra="ignore" silently discards unknown fields, making typos in field names difficult to debug. With extra="forbid", users get immediate ValidationError feedback when they misspell a parameter.

Changes:

  • Add oceanum/_base.py with StrictBaseModel base class
  • Update all 17 model classes across datamesh/ and cli/ to use StrictBaseModel
  • Add tests verifying the forbid behavior

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.

1 participant

Comments