Skip to content

Post without @RequestBody not getting all fields #1455

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

Closed
yzqdev opened this issue Jan 20, 2022 · 1 comment
Closed

Post without @RequestBody not getting all fields #1455

yzqdev opened this issue Jan 20, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@yzqdev
Copy link

yzqdev commented Jan 20, 2022

My minimal example is here https://github.com/yzqdev/springdoc-demo

Expected behavior
it's expected as the image below
(i also have a springfox-demo here to show th expected result. https://github.com/yzqdev/springfox-demo )

image

while it is like this(I didn't add a @responsebody annotation on this parameter)

image

@bnasslahsen
Copy link
Collaborator

bnasslahsen commented Jan 20, 2022

@yzqdev,

I am adding a small fix for it. But you should @ParameterObject, if you want to get all the properties of your object parsed as separate query parameters:

    @PostMapping("/query")
    public User query(@ParameterObject User user) {
        return user;
    }

@bnasslahsen bnasslahsen added invalid This doesn't seem right bug Something isn't working and removed invalid This doesn't seem right labels Jan 20, 2022
mpleine pushed a commit to mpleine/springdoc-openapi that referenced this issue May 17, 2025
mpleine pushed a commit to mpleine/springdoc-openapi that referenced this issue May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants