question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extra parameters generated for endpoint

See original GitHub issue

Just upgraded springfox-swagger2 from 2.6.1 to 2.9.2.

Noticed behavior change I don’t fully get. For method signature

  @PostMapping("/login")
  public ResponseEntity<TokenDto> login(@RequestParam(required = false) Boolean rememberMe,
      @RequestParam(required = false) String otp,
      Authentication authentication, UriComponentsBuilder uriBuilder)

weird param list generated

"parameters": [
          {
            "name": "authenticated",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "authorities[0].authority",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "credentials",
            "in": "query",
            "required": false,
            "type": "object"
          },
          {
            "name": "details",
            "in": "query",
            "required": false,
            "type": "object"
          },
          {
            "name": "otp",
            "in": "query",
            "description": "otp",
            "required": false,
            "type": "string"
          },
          {
            "name": "principal",
            "in": "query",
            "required": false,
            "type": "object"
          },
          {
            "name": "rememberMe",
            "in": "query",
            "description": "rememberMe",
            "required": false,
            "type": "boolean"
          }
        ]

Prior to upgrade this method correctly had 2 params. Didn’t find anything related in changelog, where should I look at?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
plathubcommented, Jun 5, 2019

You can use @ApiIgnore annotation until this has been fixed:

@PostMapping("/login")
  public ResponseEntity<TokenDto> login(@RequestParam(required = false) Boolean rememberMe,
      @RequestParam(required = false) String otp,
      @ApiIgnore Authentication authentication, 
      @ApiIgnore UriComponentsBuilder uriBuilder)
0reactions
dilipkrishcommented, Aug 16, 2020

You could do one of the following

  • create an alternate type rule for UriComponentBuilder to convert into a type you want
  • ignore the parameter using @ApiIgnore as shown above or via docket
Read more comments on GitHub >

github_iconTop Results From Across the Web

Step 3: Parameters (API reference tutorial) | Documenting APIs
Parameters are options you can pass with the endpoint (such as specifying the response format or the amount returned) to influence the response ......
Read more >
How to pass some more parameters to token endpoint web api 2
Solution for OWIN but you can catch the idea. Pass parameters: grant_type=password&username=Alice&password= ...
Read more >
Adding extra parameters to Auth Provider URLs
Is it possible to add extra parameters to the auto generated SF URLs in Auth. Provider? To be more clear, here's an example:...
Read more >
Documenting query and URL parameters for an endpoint
To describe query parameters for your endpoint, use the @queryParam annotation on the method handling it. The @queryParam annotation takes the name of...
Read more >
Use query parameters to customize responses - Microsoft Graph
On the beta endpoint, the $ prefix is optional. For example, instead of $filter , you can use filter . On the v1...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found