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

send example as response cause exception when generating with swagger #355

Open
BalloonWen opened this issue Jul 24, 2019 · 2 comments
Open
Assignees
Labels
1.6.x Merge to 1.6.x Branch 2.0.x Merge to 2.0.x Branch bug

Comments

@BalloonWen
Copy link
Contributor

send example as response cause exception when generating with swagger
Exception in thread "main" com.fizzed.rocker.RenderingException: templates/rest/handler.rocker.raw [line 26:9]: Index 1 out of bounds for length 1
at com.fizzed.rocker.runtime.DefaultRockerTemplate.__render(DefaultRockerTemplate.java:105)
at com.fizzed.rocker.runtime.DefaultRockerModel.doRender(DefaultRockerModel.java:67)
at com.fizzed.rocker.runtime.DefaultRockerModel.render(DefaultRockerModel.java:42)
at com.networknt.codegen.Generator.transfer(Generator.java:85)
at com.networknt.codegen.rest.SwaggerGenerator.generate(SwaggerGenerator.java:292)
at com.networknt.codegen.Cli.run(Cli.java:108)
at com.networknt.codegen.Cli.main(Cli.java:56)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at templates.rest.handler$Template.__doRender(handler.java:361)
at com.fizzed.rocker.runtime.DefaultRockerTemplate.__render(DefaultRockerTemplate.java:98)
... 6 more

@BalloonWen BalloonWen self-assigned this Jul 24, 2019
@BalloonWen BalloonWen added 1.6.x Merge to 1.6.x Branch 2.0.x Merge to 2.0.x Branch bug labels Jul 24, 2019
stevehu pushed a commit that referenced this issue Jul 26, 2019
* change responseExample from string to map

* -for openapi: if multiple examples, get with the fir one. key is the status code.
    if statusCode is default, status code = -1;
-for swagger generation, status code is always 200;
-added trim for http/https ports
stevehu pushed a commit that referenced this issue Jul 26, 2019
* change responseExample from string to map

* -for openapi: if multiple examples, get with the fir one. key is the status code.
    if statusCode is default, status code = -1;
-for swagger generation, status code is always 200;
-added trim for http/https ports
@stevehu
Copy link
Contributor

stevehu commented Jul 26, 2019

@stevehu
Copy link
Contributor

stevehu commented Jul 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.6.x Merge to 1.6.x Branch 2.0.x Merge to 2.0.x Branch bug
Projects
None yet
Development

No branches or pull requests

2 participants