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 router and controller on same app. #3338

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

peterschutt
Copy link
Contributor

@peterschutt peterschutt commented Apr 8, 2024

Fixes an ImproperlyConfiguredException where an app that explicitly registers an OpenAPIController on the application, and implicitly uses the OpenAPI router via the OpenAPIConfig object. This was caused by the two different handlers being given the same name as defined in litestar.constants.

PR adds a distinct name for use by the handler that serves openapi.json on the controller.

Closes #3337

Description

Closes

Fixes a case where two different handlers with the same name would be registered on an app that explicitly registers an OpenAPIController on the application, and implicitly uses the OpenAPI router via the OpenAPIConfig object.

Closes #3337
Copy link

sonarcloud bot commented Apr 8, 2024

Copy link

codecov bot commented Apr 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.27%. Comparing base (32f0ffa) to head (a1ee808).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3338   +/-   ##
=======================================
  Coverage   98.27%   98.27%           
=======================================
  Files         323      323           
  Lines       14759    14761    +2     
  Branches     2342     2342           
=======================================
+ Hits        14505    14507    +2     
  Misses        116      116           
  Partials      138      138           

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

Copy link

github-actions bot commented Apr 8, 2024

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

@peterschutt peterschutt merged commit 3f42024 into main Apr 8, 2024
28 checks passed
@peterschutt peterschutt deleted the 3337-openapi-router-and-controller-on-same-app branch April 8, 2024 08:33
peterschutt added a commit that referenced this pull request Apr 8, 2024
Fixes a case where two different handlers with the same name would be registered on an app that explicitly registers an OpenAPIController on the application, and implicitly uses the OpenAPI router via the OpenAPIConfig object.

Closes #3337

(cherry picked from commit 3f42024)
peterschutt added a commit that referenced this pull request Apr 8, 2024
Fixes a case where two different handlers with the same name would be registered on an app that explicitly registers an OpenAPIController on the application, and implicitly uses the OpenAPI router via the OpenAPIConfig object.

Closes #3337

(cherry picked from commit 3f42024)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: In 2.8.0, openapi triggers an ImproperlyConfiguredException
2 participants