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

[Java-Spring-server] Syntax error: missing comma #8976

Closed
emptyway opened this issue Dec 6, 2018 · 5 comments
Closed

[Java-Spring-server] Syntax error: missing comma #8976

emptyway opened this issue Dec 6, 2018 · 5 comments
Assignees
Milestone

Comments

@emptyway
Copy link

emptyway commented Dec 6, 2018

Description

The generated server code contains a syntax error.

Swagger-codegen version

swagger-codegen 3.0.3 installed with brew

Swagger declaration file content or url

http://petstore.swagger.io/v2/swagger.yaml

Command line used for generation
swagger-codegen generate \
  -i http://petstore.swagger.io/v2/swagger.yaml \
  -l spring \
  -o samples/server/petstore/springboot
Related issues/PRs

probably #8631

Actual generated code

UserApi.java

    default ResponseEntity<Void> updateUser(@ApiParam(value = "Updated user object" ,required=true )  @Valid @RequestBody User body@ApiParam(value = "name that need to be updated",required=true) @PathVariable("username") String username) {

Expected generated code

UserApi.java

    default ResponseEntity<Void> updateUser(@ApiParam(value = "Updated user object" ,required=true )  @Valid @RequestBody User body,
                                            @ApiParam(value = "name that need to be updated",required=true) @PathVariable("username") String username) {
@emptyway
Copy link
Author

emptyway commented Dec 6, 2018

its a regression bug. worked in v3.0.2

@HugoMario HugoMario added this to the v3.0.4 milestone Dec 7, 2018
@HugoMario HugoMario self-assigned this Dec 7, 2018
@HugoMario HugoMario mentioned this issue Dec 7, 2018
@HugoMario
Copy link
Contributor

Hello @simonlinj

I added a PR fixing this, can you please verify it when you have a chance?

@emptyway
Copy link
Author

emptyway commented Dec 9, 2018

still not fixed on 3.0.4-SNAPSHOT

/Users/simon/test/spring-boot-docker/build/swagger-code-api/src/main/java/example/api/UserApi.java:164: error: illegal start of expression
    default ResponseEntity<Void> updateUser(@ApiParam(value = "Updated user object" ,required=true )  @Valid @RequestBody User body@ApiParam(value = "name that need to be updated",required=true) @PathVariable("username") String username) {

@HugoMario
Copy link
Contributor

@simonlinj
just added a new PR, you can try it with https://oss.sonatype.org/content/repositories/snapshots/io/swagger/codegen/v3/swagger-codegen-cli/3.0.4-SNAPSHOT/swagger-codegen-cli-3.0.4-20181211.195230-10.jar

If there is something wrong please let me know and i´ll fix as soon as possible.

@emptyway
Copy link
Author

@HugoMario
it's fixed now, hope you can release it soon. thank you very much!

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

2 participants