Skip to content

feat: export logicalTypeOptions as pydantic.Field constraints - #1678

Merged
jschoedl merged 2 commits into
datacontract:mainfrom
amassoudi:feat/pydantic-field-constraints
Sep 30, 2026
Merged

jschoedl merged 2 commits into
datacontract:mainfrom
amassoudi:feat/pydantic-field-constraints

Conversation

@amassoudi

@amassoudi amassoudi commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

datacontract export pydantic-model maps logicalTypeOptions (pattern, minLength, maxLength, minimum, maximum, exclusiveMinimum, exclusiveMaximum) to pydantic.Field constraints, so the generated model rejects what datacontract test already flags. Optional fields now default to None.

Closes #1679

  • Tests pass (uv run pytest)
  • Code formatted (uv run ruff check --fix && uv run ruff format)
  • Docs updated (if relevant)
  • CHANGELOG.md entry added

@amassoudi
amassoudi force-pushed the feat/pydantic-field-constraints branch from aa41640 to 1e1b308 Compare September 30, 2026 09:28
@jschoedl

Copy link
Copy Markdown
Collaborator

Thank you!

@jschoedl
jschoedl merged commit 360f7fd into datacontract:main Sep 30, 2026
19 checks passed
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.

export pydantic-model: logicalTypeOptions (pattern, minLength, minimum, ...) are dropped from the generated model

3 participants