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): Document unconsumed path parameters #3295

Merged
merged 2 commits into from Mar 30, 2024

Conversation

provinzkraut
Copy link
Member

Fix a bug where path parameters not consumed by route handlers would not be included in the OpenAPI schema.

from litestar import Litestar, get


@get("/{param:str}")
async def handler() -> None:
    pass

This could would not include the {param} in the schema, yet it is still required to be passed when calling the path.

Fix #3290.

@provinzkraut provinzkraut requested review from a team as code owners March 30, 2024 17:51
@provinzkraut provinzkraut enabled auto-merge (squash) March 30, 2024 18:21
@provinzkraut provinzkraut force-pushed the document-unconsumed-path-params branch from 171b3ee to c3d9853 Compare March 30, 2024 18:26
Copy link

codecov bot commented Mar 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.23%. Comparing base (576bae9) to head (c3d9853).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3295   +/-   ##
=======================================
  Coverage   98.23%   98.23%           
=======================================
  Files         320      320           
  Lines       14474    14476    +2     
  Branches     2304     2304           
=======================================
+ Hits        14219    14221    +2     
  Misses        114      114           
  Partials      141      141           

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

Copy link

sonarcloud bot commented Mar 30, 2024

@provinzkraut provinzkraut merged commit 3ea7c15 into main Mar 30, 2024
21 checks passed
@provinzkraut provinzkraut deleted the document-unconsumed-path-params branch March 30, 2024 18:30
Copy link

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

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.

Bug: Path parameters missing from OpenAPI schema when not included in handler signature
2 participants