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: openapi parameter order doesn't match the order in the path #3644

Open
4 tasks
ashanbrown opened this issue Jul 24, 2024 · 0 comments
Open
4 tasks

Bug: openapi parameter order doesn't match the order in the path #3644

ashanbrown opened this issue Jul 24, 2024 · 0 comments
Labels
Bug 🐛 This is something that is not working as expected OpenAPI This is related to our OpenAPI schema

Comments

@ashanbrown
Copy link

ashanbrown commented Jul 24, 2024

Description

Unconsumed parameters appear to be added last to the openapi spec, which causes strange parameter ordering in other generated code. It looks like some effort was made to account for this at https://github.com/litestar-org/litestar/blame/ffaf5616b19f6f0f4128209c8b49dbcb41568aa2/tests/unit/test_openapi/test_schema.py#L613. I'm wondering if this is really the desired behavior. I would have expected the order in the openapi spec to match the order in the path. As it stands, it means that consuming a dependency will change the openapi spec and code generated from it.

URL to code causing the issue

No response

MCVE

No response

Steps to reproduce

No response

Screenshots

No response

Logs

No response

Litestar Version

2.9.1

Platform

  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)

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
@ashanbrown ashanbrown added the Bug 🐛 This is something that is not working as expected label Jul 24, 2024
@ashanbrown ashanbrown changed the title Bug: openapi parameter order depends on whether a dependency is consumed Bug: openapi parameter order doesn't match the order in the path Jul 24, 2024
@JacobCoffee JacobCoffee added the OpenAPI This is related to our OpenAPI schema label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 This is something that is not working as expected OpenAPI This is related to our OpenAPI schema
Projects
None yet
Development

No branches or pull requests

2 participants