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

Unable to generate document with swagger UI - error Uncaught TypeError: Cannot read property 'toLowerCase' of undefined #1908

Closed
ReenaRobinson opened this issue Jan 22, 2016 · 2 comments

Comments

@ReenaRobinson
Copy link

Using swagger-ui version 2.1.4 and io.swagger version 1.5.6, we are trying to generate the swagger doc for the following REST API:

  @PUT 
  @ApiResponses( value =
  {
     @ApiResponse( code = 200, message = "OK" ),
     @ApiResponse( code = 400, message = "Bad request" ),
    } )
  public Response activateServer( @QueryParam( "enabled" )
  Boolean status ) throws BadRequestException;

While invoking the swagger ui index.html page, the following error is shown in the browser console. "Uncaught TypeError: Cannot read property 'toLowerCase' of undefined"
We are using chrome browser version 47.0.2526.111 m.

We also noticed that this error does not occur for QueryParam data types like string or integer. However, here we require a boolean data type and hence, we are unable to generate the document.

@webron
Copy link
Contributor

webron commented Jan 22, 2016

@ReenaRobinson - we'd need to have the Swagger spec fie you get generated from swagger-core.

@ReenaRobinson
Copy link
Author

Thanks for your prompt response. However, the issue was solved as we were missing the @QueryParam in the implementation. The annotation was only given at the interface level.
Note that since Boolean is a wrapper class, the annotation was required at both interface as well as implementation.

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

No branches or pull requests

3 participants