-
-
Notifications
You must be signed in to change notification settings - Fork 376
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: Enum OAS generation (#3518) #3525
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3525 +/- ##
=======================================
Coverage 98.28% 98.28%
=======================================
Files 328 328
Lines 14886 14890 +4
Branches 2367 2367
=======================================
+ Hits 14631 14635 +4
Misses 116 116
Partials 139 139 ☔ View full report in Codecov by Sentry. |
Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3525 |
Thanks for the PR, but I believe your work kind of invalidates the work done here #2550? Can you check the MCVE from the issue and confirm if this affects anything? @JacobCoffee and @peterschutt ping for awareness |
I feel like there's been some lengthy discussion around this recently, in discord I think?? Is this that same issue? |
This is the only thread I am aware of, raised by the same person |
The one I'm thinking of starts here - it was a long discussion and not put into a thread unfortunately. Feels related. |
Hi, @Alc-Alc and @peterschutt, thx for your comments. I read the #2546 issue and i think it is related to my issue, but it is more about the work of enum with optional in general
I fix just two test - test_optional_enum and part with enum params in test_create_parameters. So other things with optional fields work as before CC: @provinzkraut |
Have you confirmed if your changes are not affecting that? from enum import StrEnum
from litestar import Litestar, get
from litestar.params import Parameter
class Environment(StrEnum):
DEVELOPMENT = "dev"
TEST = "test"
QA = "qa"
@get(path="/")
async def test(
environment: Environment | None
= Parameter(
title="Environment",
description="The environment to filter by.",
default=None,
required=False,
),
) -> Environment | None:
return environment
app = Litestar([test]) Current main Your branch |
Yes, my changes affected that, because Enum now putted in components And it is really strange, that swagger register Enum object here I think we should ask the swagger team about this) |
@Alc-Alc Just a ping:) |
apologies for the delay here and thanks for being responsive, I am not much of an authority when it comes to OpenAPI, but if you claim it's a swagger issue, then I have nothing against this being merged, however I would appreciate if @peterschutt and other @litestar-org/maintainers take a look. |
@peterschutt @Alc-Alc |
Not from me at this point @wallseat - apologies, but I've got a bit going on at work at the moment and haven't had a chance to look at anything litestar related for the last few weeks. |
@provinzkraut |
@wallseat The fix seem reasonable, I'm just concerned about breaking swagger. I'd like to confirm this is an issue on their end, not ours (and potentially just avoid breaking this for our users, since a lot of them use this as their primary interactive docs 👀) IMO we can move forward if we have either confirmation that it's a swagger bug, or a way to not break this for our users. |
Hello everyone! I have the same problem with What will happen with this fix? |
Changes described here #3518
Closes
Closes #3518