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): YAML schema dump #3537

Merged
merged 2 commits into from
Jun 1, 2024

Conversation

floxay
Copy link
Contributor

@floxay floxay commented May 31, 2024

Description

Fixes an issue in the OpenAPI YAML schema dump logic of OpenAPIController where the endpoint for the OpenAPI YAML schema file returns an empty response if a request has been made to the OpenAPI JSON schema previously due to an incorrect variable check.

Closes

Edit from @Alc-Alc: https://discord.com/channels/919193495116337154/919193495690936353/1246024918487793744 explains the need for this

Copy link

codecov bot commented May 31, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 98.28%. Comparing base (972ee67) to head (efa4fd1).

Files Patch % Lines
litestar/openapi/controller.py 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3537   +/-   ##
=======================================
  Coverage   98.28%   98.28%           
=======================================
  Files         328      328           
  Lines       14848    14848           
  Branches     2358     2358           
=======================================
  Hits        14593    14593           
  Misses        116      116           
  Partials      139      139           

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

Copy link
Contributor

@Alc-Alc Alc-Alc left a comment

Choose a reason for hiding this comment

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

does this need a test? if so how to test it? but its a go from me 🙂

Copy link

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

@floxay
Copy link
Contributor Author

floxay commented May 31, 2024

does this need a test? if so how to test it? but its a go from me 🙂

Added a test for this in efa4fd1 on the OpenAPIController, as the new system using OpenAPIRenderPlugin (JsonRenderPlugin and YamlRenderPlugin) does not have this issue.

I suspect #2634 is related but it got mistakenly closed due to the nature of this bug, so one more reason to add a test I guess :D

@JacobCoffee
Copy link
Member

thanks for contributing again :)

@JacobCoffee JacobCoffee merged commit 54cf233 into litestar-org:main Jun 1, 2024
24 of 25 checks passed
@floxay floxay deleted the fix-openapi-yaml branch June 1, 2024 10:04
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.

4 participants