Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

r4victor
Copy link
Collaborator

@r4victor r4victor commented Sep 8, 2025

Fixes #3066

The PR introduces generate_dual_core_model() that generates CoreModel with a custom config on the fly. This allows models to have custom configs and pyndatic-duality's behavior at the same time. Previously, models that defined custom Configs had __response__.extra == "forbid", breaking pyndatic-duality's behavior. To use custom configs in generate_dual_core_model(), they are moved from model classes to the top level.

  • schema_extra (usual case for custom config) works as before and modifies json schema appropriately.
  • models with custom configs have __response__.extra == "ignore" as expected.

@r4victor r4victor requested review from jvstme and un-def September 8, 2025 10:18
@r4victor r4victor merged commit b8f2ade into master Sep 9, 2025
28 checks passed
@r4victor r4victor deleted the issue_3066_duality_config branch September 9, 2025 08:21
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.

[Bug]: Pydantic models with overridden Config fail to parse with extra=ignore

2 participants