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

@Parameter(required = false) not work when I use @GetMapping #1858

Closed
jwang0512 opened this issue Sep 23, 2022 · 1 comment
Closed

@Parameter(required = false) not work when I use @GetMapping #1858

jwang0512 opened this issue Sep 23, 2022 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@jwang0512
Copy link

jwang0512 commented Sep 23, 2022

yes, this already answered in #252

but I think springdoc annotation @parameter(required = false) should override this default behavior.

and:

    @GetMapping("/list")
    public List<DemoItem> list(Integer category, String filter, Integer page, Integer size, String sort) {
    }

curl -v 'http://localhost:8080/list' works well without parameters. why springdoc requires an extra work like:

    public List<DemoItem> list(@RequestParam(required = false) Integer category, @RequestParam(required = false) String filter, @RequestParam(required = false) Integer page, @RequestParam(required = false) Integer size, @RequestParam(required = false) String sort) {
    }

it is long and ugly :)

@bnasslahsen bnasslahsen added the duplicate This issue or pull request already exists label Sep 29, 2022
@bnasslahsen
Copy link
Contributor

see #252 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants