Skip to content

Support disabling separate input and output schemas#369

Merged
zmievsa merged 1 commit intozmievsa:mainfrom
kouk:separate-input-and-output
Apr 20, 2026
Merged

Support disabling separate input and output schemas#369
zmievsa merged 1 commit intozmievsa:mainfrom
kouk:separate-input-and-output

Conversation

@kouk
Copy link
Copy Markdown
Contributor

@kouk kouk commented Apr 16, 2026

There are cases where the validation and serialization schema of a model will be different. In this case the default for FastAPI is to generate an input schema and an output schema. It can be disabled with an option which however is not being passed by Cadwyn down to FastAPI.

https://fastapi.tiangolo.com/how-to/separate-openapi-schemas/#model-for-input

Note that the mere presence of defaults is, contrary to what the fastapi docs say, not sufficient to produce differing schemas, at least since pydantic/pydantic#7275

@kouk kouk marked this pull request as draft April 17, 2026 12:15
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.84%. Comparing base (6a7325f) to head (5218528).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #369   +/-   ##
=======================================
  Coverage   99.84%   99.84%           
=======================================
  Files          72       72           
  Lines        5708     5708           
  Branches      362      362           
=======================================
  Hits         5699     5699           
  Misses          9        9           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zmievsa
Copy link
Copy Markdown
Owner

zmievsa commented Apr 20, 2026

@kouk lint and codecov are failing

Comment thread tests/test_separate_input_and_output_schemas.py Outdated
@kouk kouk force-pushed the separate-input-and-output branch from dddbcc7 to 5218528 Compare April 20, 2026 11:22
@kouk kouk marked this pull request as ready for review April 20, 2026 11:23
@kouk
Copy link
Copy Markdown
Contributor Author

kouk commented Apr 20, 2026

@zmievsa this is now ready.

Copy link
Copy Markdown
Owner

@zmievsa zmievsa left a comment

Choose a reason for hiding this comment

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

Thank you for the fix!!!

@zmievsa zmievsa merged commit e03c6c8 into zmievsa:main Apr 20, 2026
14 checks passed
@zmievsa
Copy link
Copy Markdown
Owner

zmievsa commented Apr 20, 2026

Released both this and your other PR in the latest bugfix version

@kouk
Copy link
Copy Markdown
Contributor Author

kouk commented Apr 20, 2026

Thank you @zmievsa . Although I don't see this one in 6.2.1. 6.2.1...main
But it can wait until you have more to release. I might have another fix in mind (will open an issue to discuss).

@zmievsa
Copy link
Copy Markdown
Owner

zmievsa commented Apr 20, 2026

My bad. Will double check in an hour

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