Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Params - add style & explode parameter for deepObject/… encoding#9867

Open
commonism wants to merge 1 commit intofastapi:masterfastapi/fastapi:masterfrom
commonism:deepObjectcommonism/fastapi:deepObjectCopy head branch name to clipboard
Open

Params - add style & explode parameter for deepObject/… encoding#9867
commonism wants to merge 1 commit intofastapi:masterfastapi/fastapi:masterfrom
commonism:deepObjectcommonism/fastapi:deepObjectCopy head branch name to clipboard

Conversation

@commonism
Copy link

@commonism commonism commented Jul 12, 2023

Hi,

this PR basically picks up the idea by @adriangb using ` … = Query(style="deepObject") for models in query parameters.
While it currently only serves deepObject for query parameters, it could do the job for all Parameters - depending on the encoding styles/explode combinations supported,

https://spec.openapis.org/oas/v3.1.0#style-examples

Questions -

  • is supporting Parameter encoding (e.g. deepObject for query parameters) actually intended to be supported by fastapi
  • which style/explode combinations to support (for which parameter types),
    • matrix
    • label
    • form
    • simple
    • spaceDelimited
    • pipeDelimited
    • deepObject

This does deepObject.

This is a clone of #9768 which got closed when deleting a branch.

fixes: #3163

@commonism commonism force-pushed the deepObject branch 6 times, most recently from 736dcf5 to 601b40d Compare July 13, 2023 06:20
@beubeu13220
Copy link

It would be very helpful :)

@JoshYuJump
Copy link

@commonism
I am wondering whether other style is compatible when I using Query(style="deepObject") explicitly?

@commonism
Copy link
Author

The deepObject encoding is not compatible to any other encoding.
… all encodings are not interchangeable/compatible, similar to a type specification for a variable.
You need to serve the encoding required.

@alejsdev alejsdev added the p4 label Jan 14, 2024
@HansBambel
Copy link

This would indeed be helpful. Thank you for the PR!

@commonism
Copy link
Author

I rebased the changes.

The failure in the CI is related to the documentation build.


Run python ./scripts/docs.py build-lang en
  python ./scripts/docs.py build-lang en
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.11.9/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.9/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.9/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.9/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.9/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.9/x64/lib
Insiders file None
Building docs for: en
INFO    -  [macros] - Macros arguments: {'module_name': 'main', 'modules': [], 'render_by_default': True, 'include_dir': '', 'include_yaml': [{'external_links': '../en/data/external_links.yml'}, {'github_sponsors': '../en/data/github_sponsors.yml'}, {'people': '../en/data/people.yml'}, {'sponsors_badge': '../en/data/sponsors_badge.yml'}, {'sponsors': '../en/data/sponsors.yml'}], 'j2_block_start_string': '', 'j2_block_end_string': '', 'j2_variable_start_string': '', 'j2_variable_end_string': '', 'on_undefined': 'keep', 'on_error_fail': False, 'verbose': False}
INFO    -  [macros] - Loading yaml file: /home/runner/work/fastapi/fastapi/docs/en/../en/data/external_links.yml
INFO    -  [macros] - Loading yaml file: /home/runner/work/fastapi/fastapi/docs/en/../en/data/github_sponsors.yml
INFO    -  [macros] - Loading yaml file: /home/runner/work/fastapi/fastapi/docs/en/../en/data/people.yml
INFO    -  [macros] - Loading yaml file: /home/runner/work/fastapi/fastapi/docs/en/../en/data/sponsors_badge.yml
INFO    -  [macros] - Loading yaml file: /home/runner/work/fastapi/fastapi/docs/en/../en/data/sponsors.yml
INFO    -  [macros] - Extra variables (config file): ['analytics', 'social', 'alternate']
INFO    -  [macros] - Extra filters (module): ['pretty']
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory: /home/runner/work/fastapi/fastapi/site_build/en
INFO    -  DeprecationWarning: Passing multiple extensions as a single list or tuple is deprecated. Please pass them as separate arguments instead.
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/mkdocstrings_handlers/python/handler.py", line 275, in collect
    extensions=load_extensions(extensions),
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/griffe/extensions/base.py", line 481, in load_extensions
    warnings.warn(

ERROR   -  Error reading page 'reference/apirouter.md': list index out of range

Not sure what is causing this.
So far I consider it unrelated to the changes.

@eyueldk
Copy link

eyueldk commented May 15, 2025

Unfortunate this hasn't been accepted. It would really simplify accepting type safe complex objects in the route.

@commonism
Copy link
Author

Just had a look on re-basing.
Ain't easy this time.

@github-actions

This comment was marked as outdated.

@commonism commonism force-pushed the deepObject branch 4 times, most recently from 6dd6305 to 98877ee Compare May 25, 2025 06:11
@github-actions

This comment was marked as outdated.

@commonism
Copy link
Author

Rebased

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions github-actions bot removed the conflicts Automatically generated when a PR has a merge conflict label Nov 4, 2025
@commonism commonism force-pushed the deepObject branch 2 times, most recently from d53f38c to f6261e2 Compare November 4, 2025 12:31
@github-actions github-actions bot added the conflicts Automatically generated when a PR has a merge conflict label Nov 19, 2025
@github-actions

This comment was marked as resolved.

@commonism commonism force-pushed the deepObject branch 2 times, most recently from f6261e2 to 096938d Compare November 20, 2025 06:36
@github-actions github-actions bot removed the conflicts Automatically generated when a PR has a merge conflict label Nov 20, 2025
@commonism commonism force-pushed the deepObject branch 2 times, most recently from 8a27ae1 to 26c4a99 Compare November 20, 2025 10:05
@github-actions github-actions bot added the conflicts Automatically generated when a PR has a merge conflict label Dec 4, 2025
@github-actions

This comment was marked as resolved.

@github-actions github-actions bot removed the conflicts Automatically generated when a PR has a merge conflict label Dec 4, 2025
@github-actions github-actions bot added the conflicts Automatically generated when a PR has a merge conflict label Dec 12, 2025
@github-actions
Copy link
Contributor

This pull request has a merge conflict that needs to be resolved.

@github-actions github-actions bot removed the conflicts Automatically generated when a PR has a merge conflict label Feb 6, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 6, 2026

Merging this PR will not alter performance

✅ 20 untouched benchmarks


Comparing commonism:deepObject (6e55cd5) with master (cf55bad)1

Open in CodSpeed

Footnotes

  1. No successful run was found on master (cc6ced6) during the generation of this report, so cf55bad was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@commonism commonism force-pushed the deepObject branch 2 times, most recently from d345801 to 8dc3f28 Compare February 6, 2026 07:24
@github-actions github-actions bot added the conflicts Automatically generated when a PR has a merge conflict label Feb 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

This pull request has a merge conflict that needs to be resolved.

allows deepObject encoded Query parameters
@github-actions github-actions bot added conflicts Automatically generated when a PR has a merge conflict and removed conflicts Automatically generated when a PR has a merge conflict labels Feb 7, 2026
@github-actions
Copy link
Contributor

This pull request has a merge conflict that needs to be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts Automatically generated when a PR has a merge conflict feature New feature or request p4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAPI deepObject serialization for query parameters

7 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.