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] code style improvement #10264

Closed
5 of 6 tasks
artemitin opened this issue Aug 25, 2021 · 0 comments · Fixed by #10265
Closed
5 of 6 tasks

[Java] [Spring] code style improvement #10264

artemitin opened this issue Aug 25, 2021 · 0 comments · Fixed by #10265

Comments

@artemitin
Copy link
Contributor

artemitin commented Aug 25, 2021

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

In Java Spring generator: Inconsistent and nonconventional use/absence of spaces in method signatures in generated *Api.java.

Generated:

default ResponseEntity<Void> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true )  @Valid @RequestBody Pet body) {
        return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
    }

Should be:

default ResponseEntity<Void> addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body) {
        return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
    }
openapi-generator version

5.2.1, master

Generation Details

gradle task config, using downloaded https://petstore.swagger.io/v2/swagger.json

openApiGenerate {
    generatorName = "spring"
    inputSpec = "$projectDir/src/main/resources/swagger.json"
Steps to reproduce

generate and see *Api.java classes

Suggest a fix

adjust templates in src/main/resources/JavaSpring

wing328 pushed a commit that referenced this issue Aug 28, 2021
* TAP-198 fix spaces in spring java

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

Successfully merging a pull request may close this issue.

1 participant