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.

ApiImplicitParams not working as expected

See original GitHub issue
@ApiOperation("Create a new MyEntity")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "myEntity", dataType = "MyEntity", paramType = "body", required = true)
    })
    @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = MyEntity.class),
            @ApiResponse(code = 401, message = "Unauthorized"),
            @ApiResponse(code = 500, message = "Internal Server Error"),
            @ApiResponse(code = 400, message = "Bad Request"),
            @ApiResponse(code = 404, message = "Not Found") })
    @PostMapping
    public ResponseEntity<MyEntity> createMyEntity(@RequestBody Map<String, Object> request)

_Originally posted by @timothy-mugayi in https://github.com/springfox/springfox/issues/2195#issuecomment-433822289_

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:3
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
timothy-mugayicommented, Nov 7, 2018

@dilipkrish please change response = Campaign.class to MyEntity.class typo

0reactions
JohnLKramercommented, Nov 4, 2022

I’m using ApiImplicitParams with a header parameters. Not working either.

    @GET
    @ApiOperation(value = "Authenticate request. Verify Authorization token (if any) is valid. Allow admin endpoints to be authenticated.")
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Authentication success"),
            @ApiResponse(code = 204, message = "No content"),
            @ApiResponse(code = 403, message = "Forbidden")
    })
    @ApiImplicitParams(
            @ApiImplicitParam(name = "Authorization", value = "Token 1234", type = "header")
    )
    @Path("/authenticateAllowAdmin")
    public Response authenticateAllowAdmin(@Context HttpServletRequest httpRequest) {
        return authenticateImpl(httpRequest, true, false);
    }

There’s no header parameter.

Screen Shot 2022-11-03 at 9 31 47 PM
Read more comments on GitHub >

github_iconTop Results From Across the Web

Swagger datatype not generating docs - Stack Overflow
According to this GitHub issue on Swagger core project, if you add the annotation @ApiImplicitParam should resolve your problem.
Read more >
ApiImplicitParam (swagger-annotations 1.6.2 API) - Javadoc.io
Represents a single parameter in an API Operation. While ApiParam is bound to a JAX-RS parameter, method or field, this allows you to...
Read more >
ApiImplicitParam (swagger-annotations 1.3.10 API)
Represents a single parameter in an API Operation. While ApiParam is bound to a JAX-RS parameter, method or field, this allows you to...
Read more >
Error in using swagger annotations for non-primitive query ...
I'm not sure how easy it would be to overcome this due to type erasure, but we'll see. ... The @ApiImplicitParam doesn't seem...
Read more >
ApiImplicitParam not showing File param on swagger UI
I am creating swagger document using annotations in springboot application, all the APIs params are working instead of file param, ...
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