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 typing.NewType #3580

Merged
merged 3 commits into from
Jun 20, 2024
Merged

Conversation

provinzkraut
Copy link
Member

When encountering a typing.NewType during OpenAPI schema generation, we currently treat it as an opaque type. This PR changes the behaviour such that typing.NewTypes are always unwrapped during schema generation.

@provinzkraut provinzkraut requested review from a team as code owners June 17, 2024 16:51
@github-actions github-actions bot added area/private-api This PR involves changes to the privatized API size: small type/bug pr/internal labels Jun 17, 2024
Copy link

codecov bot commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.27%. Comparing base (3de1b1d) to head (e7711db).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3580   +/-   ##
=======================================
  Coverage   98.27%   98.27%           
=======================================
  Files         328      328           
  Lines       14856    14868   +12     
  Branches     2363     2366    +3     
=======================================
+ Hits        14599    14611   +12     
  Misses        116      116           
  Partials      141      141           

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

Copy link

sonarcloud bot commented Jun 18, 2024

Copy link

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

Copy link
Member

@cofin cofin left a comment

Choose a reason for hiding this comment

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

LGTM. Sorry this took so long.

@provinzkraut provinzkraut merged commit 2e4b820 into main Jun 20, 2024
26 checks passed
@provinzkraut provinzkraut deleted the fix-openapi-newtype branch June 20, 2024 18:06
provinzkraut added a commit that referenced this pull request Jun 21, 2024
* Unwrap NewType for OpenAPI schema
* Support nested NewType

(cherry picked from commit 2e4b820)
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.

None yet

3 participants