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

Question : query param as post creates 2 doc snippets of in: body #84

Open
PankajWorks opened this issue Nov 29, 2018 · 1 comment
Open

Comments

@PankajWorks
Copy link

PankajWorks commented Nov 29, 2018

Hi,
Need an help here :

override protected def routes = authenticated { uc => concat(assignRole(uc), getUserInfo(uc))}

and signature of a function looks like

def assignRole(uc: UserContext): Route = path(JavaUUID)

Now when i try to add a

@ApiImplicitParams(Array(
new ApiImplicitParam(name = "userId", required = true, dataType = "string", paramType = "body")
))
and generate doc the doc contains

"parameters" : [ {
          "in" : "body",
          "name" : "body",
          "required" : false,
          "schema" : {
            "$ref" : "#/definitions/UserContext"
          }
        }, {
          "name" : "userId",
          "in" : "body",
          "required" : true,
          "type" : "string"
        },

Since there are 2 params of type body the validation of doc fails has more than 1 body param

Any suggestions how we can override the default body tag

@pjfanning
Copy link
Collaborator

The generated swagger params are the sum of the params in the method that is annotated and the ApiImplicitParams from the annotations.

If you want to omit a parameter that is in your method's param list, use the annotations described in https://stackoverflow.com/questions/22812365/how-to-hide-a-parameter-in-swagger (hidden=true)

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

No branches or pull requests

2 participants