Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

@ApiParam is ignored if its used with @PathParam with class field #152

Open
ashok1979sharma opened this issue Sep 29, 2019 · 0 comments
Open

Comments

@ashok1979sharma
Copy link

I have @path like below in my api
@path(/abcd/{mycontext}/pqr/{newkey}/users)

in this path there are two path parameters are used "mycontext" and "newkey". There parameters are defined as a class filed not as method argument, like below

@PathParam("mycontext")
private String mycontext;

@PathParam("newkey")
private String newkey

My get method is defined like this

@get
@produces({MediaType.APPLICATION_XML})
public Response getUsre() {
...
...
}

When I use @ApiParam like below, its getting ignored and I am getting validation error when generating ui with the generated json
(Declared path parameter "mycontext" needs to be defined as a path parameter at either the path or operation level)

@ApiParam(value = "My Context", required = true)
@PathParam("mycontext")
private String mycontext;

@ApiParam(value = "New key", required = true)
@PathParam("newkey")
private String newkey

Can anybody suggest me how to avoid this problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant