Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(OpenAPI): Correctly handle msgspec.Struct tagged unions #3742

Merged
merged 3 commits into from
Sep 15, 2024

Conversation

provinzkraut
Copy link
Member

Fix a bug where we would not include the struct fields implicitly generated by msgspec for its tagged union support.

The change consists of an addition to the OpenAPI plugin where the tagged field will be added as a const to the schema.

Fix #3659.

@provinzkraut provinzkraut requested review from a team as code owners September 15, 2024 14:31
@github-actions github-actions bot added area/private-api This PR involves changes to the privatized API size: small type/bug labels Sep 15, 2024
@provinzkraut provinzkraut force-pushed the fix/3659-msgspec-tag-field-not-included-in-schema branch from 7324618 to d95e79c Compare September 15, 2024 14:31
@provinzkraut provinzkraut enabled auto-merge (squash) September 15, 2024 14:35
Copy link

codecov bot commented Sep 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.35%. Comparing base (f2ed95d) to head (6e22131).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3742   +/-   ##
=======================================
  Coverage   98.34%   98.35%           
=======================================
  Files         331      331           
  Lines       15272    15277    +5     
  Branches     2444     2446    +2     
=======================================
+ Hits        15020    15025    +5     
  Misses        112      112           
  Partials      140      140           

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

Copy link

Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3742

@provinzkraut provinzkraut merged commit bb1d0d4 into main Sep 15, 2024
26 checks passed
@provinzkraut provinzkraut deleted the fix/3659-msgspec-tag-field-not-included-in-schema branch September 15, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/private-api This PR involves changes to the privatized API pr/internal size: small type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: tag_field not presented on swagger schemas when using Union
2 participants