Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Specifying parameters in openapi_extras overrides query parameters, rather than appending them #4268

Closed
9 tasks done
orilevari opened this issue Dec 11, 2021 · 2 comments
Closed
9 tasks done
Labels
question Question or problem question-migrate

Comments

@orilevari
Copy link
Contributor

orilevari commented Dec 11, 2021

First Check

  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the FastAPI documentation, with the integrated search.
  • I already searched in Google "How to X in FastAPI" and didn't find any information.
  • I already read and followed all the tutorial in the docs and didn't find an answer.
  • I already checked if it is not related to FastAPI but to Pydantic.
  • I already checked if it is not related to FastAPI but to Swagger UI.
  • I already checked if it is not related to FastAPI but to ReDoc.

Commit to Help

  • I commit to help with one of those options 👆

Example Code

See the PR I opened with a fix: #4267 It includes a test case that describes the use case.

Description

When specifying parameters in openapi_extras for an endpoint, they will overwrite the existing query parameters with the extra parameters, rather than appending the parameters to the spec. This is due to deep_dict_update in utils.py overwriting list types rather than merging them together.

I have created a PR already which has a fix and adds a test case: #4267
These updates change the behavior to merge parameters together rather than overwriting.

If y'all agree that this seems like a bug, I'd appreciate a review on the PR. Thanks in advance! 😄

Operating System

macOS

Operating System Details

No response

FastAPI Version

0.70.0

Python Version

Python 3.9.7

Additional Context

No response

@orilevari orilevari added the question Question or problem label Dec 11, 2021
@orilevari orilevari changed the title Specifying parameters in openapi_extras overrides rather than appending Specifying parameters in openapi_extras overrides query parameters, rather than appending them Dec 11, 2021
@orilevari
Copy link
Contributor Author

PR got merged! Closing now

@tiangolo
Copy link
Owner

tiangolo commented Nov 7, 2022

Thanks for coming back to close it! ☕🍰

@tiangolo tiangolo reopened this Feb 27, 2023
Repository owner locked and limited conversation to collaborators Feb 27, 2023
@tiangolo tiangolo converted this issue into discussion #6467 Feb 27, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Question or problem question-migrate
Projects
None yet
Development

No branches or pull requests

2 participants