feat(msgspec_dto): include msgspec tagged union field#4671
Draft
abdulhaq-e wants to merge 1 commit intolitestar-org:mainfrom
Draft
feat(msgspec_dto): include msgspec tagged union field#4671abdulhaq-e wants to merge 1 commit intolitestar-org:mainfrom
abdulhaq-e wants to merge 1 commit intolitestar-org:mainfrom
Conversation
Contributor
Author
|
This is similar to #3742 which added the tag field to open api. Perhaps since it's always added to Open api and since this is the new v3, it might be okay to just introduce it unconditionally. One can then exclude it if needed using |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4671 +/- ##
==========================================
+ Coverage 67.33% 67.35% +0.01%
==========================================
Files 292 292
Lines 14941 14957 +16
Branches 1676 1677 +1
==========================================
+ Hits 10061 10074 +13
- Misses 4743 4746 +3
Partials 137 137 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
When using
msgspectagged union, it is sometimes desirable to include the tag field in the DTO. This wasn't supported.The current implementation unconditionally includes this field. I believe it's a good default option, however I think we should introduce a custom
MsgspecDTOConfig(similar to what we had forSQLAlchemy) which can control this behaviour.This code was also generated using AI but this sometimes it's an area of the code base I'm more familiar with.
I've created it as draft to discuss having
MsgspecDTOConfigand the flag and for any further edits.