Conversation
mikonse
force-pushed
the
milo/pydantic-refactoring
branch
2 times, most recently
from
May 26, 2026 21:04
7795dae to
72d0c0b
Compare
Owner
|
I'm not sure about the FastAPI migration, but Pydantic instead of Marshmallow is a good change |
Contributor
Author
|
Sounds good, I'll have a look when I get time to rebase this pydantic branch onto the most recent changes and test it on my personal deployment 👍 Regarding the fastapi changes, I've also had a look at that and while I think in the longterm it would provide a better development experience than flask it is by far not as easy a drop in replacement as marshmallow -> pydantic due to the additional number of flask based plugins which this project uses. |
mikonse
force-pushed
the
milo/pydantic-refactoring
branch
from
September 5, 2026 20:57
72d0c0b to
46923fc
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As a proposal for a longer refactoring with the end goal of moving from flask + marshmallow to fastapi + pydantic this would be the first step to refactor the API datamodels from marshmallow to pydantic.
The idea behind this switch in framework / underlying library for me is that pydantic + fastapi produces a much nicer editor experience because you can rely on type checker and editor autocompletion support for the schemas and have a lower chance of getting errors into the API controller code due to typos / type mismatches.
Additionally the currently somewhat manually documented API in the kitchenowl docs could be replaced by the automatic openapi export that fastapi supports with an inline swagger API browser.
@TomBursch I'm very much open to discussion about this. If this is something you would be interested to see I'm happy to drive this forward and open pulls along the way. I'll try to keep this as multi stage refactors so we would have multiple sets of changes instead of one big change to fastapi.