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

Bug: | None removes the Upload File button in OpenAPI schema docs #3411

Open
peterschutt opened this issue Apr 21, 2024 · 0 comments
Open

Bug: | None removes the Upload File button in OpenAPI schema docs #3411

peterschutt opened this issue Apr 21, 2024 · 0 comments

Comments

@peterschutt
Copy link
Contributor

peterschutt commented Apr 21, 2024

          May need to be a separate issue, but `| None` also removes the `Upload File` button in OpenAPI schema docs :(
from litestar import Controller, Litestar, post
from litestar.datastructures import UploadFile
from litestar.enums import RequestEncodingType
from litestar.params import Body


class Files(Controller):
    @post(path="/files/upload")
    async def upload_files(
        self,
        data: UploadFile | None = Body(media_type=RequestEncodingType.MULTI_PART),
    ) -> str:
        return data


app = Litestar(route_handlers=[Files])

Without | None
image

With | None

image

Originally posted by @JacobCoffee in #3407 (comment)


Note

While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.

Check out all issues funded or available for funding on our Polar.sh dashboard

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
  • This, along with engagement in the community, helps us know which features are a priority to our users.
Fund with Polar
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

No branches or pull requests

1 participant