-
Notifications
You must be signed in to change notification settings - Fork 6k
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 jax rs code generation fix and formatting tidy #1093
Conversation
…dme-path-fix Fix path in instructions for making your own codegen modules
see https://github.com/swagger-api/swagger-codegen/pull/859/files#r37515455 for the introduction of the bug |
@ahgittin thanks! will review and let you know if I've any questions. |
@wing328 noticed the generated code did not compile in some cases due to |
c3f5992
to
ac6a051
Compare
@ahgittin under
Is this PR supposed to address that or the error is already there before you submitted the fix ? |
@ahgittin - due to a development procedure change, you'll have to resubmit the PR against the |
… `Impl` weren't written in eca8276 when `skipOverwrite` was introduced, a file exists check was moved into `DefaultCodegen.shouldOverwrite` effectively changing its semantics from "is overwriting allowed for this file" to "should we write this file". the method is overridden in `JaxRSServerCodegen` to specify that `Factory` and `Impl` files should always return false, because we never want to *overwrite* them. but the above change in semantics meant we would never *write* these files. this reverts the semantics of that method, in line with both the method name and the jax-rs interpretation, and introduces a new `shouldSkipOverwrite` which adds the file exists check and is used in places where the above commit expected the latter semantics.
alignment and line spaces were odd and inconsistent; this tries to respect the coding conventions which it seems were intended, but make them consistent (i'm not trying to bike-shed how code should be formatted, honest, just to make the formatting which it seems was intended line up!)
ac6a051
to
0fc2532
Compare
@wing328 I've rebased on master and will submit PR shortly. I've no idea why that error appeared, it is supposed to build, and when I do this (after the rebase and tidies) all works well:
|
Closing in preference to #1119 |
introduction of
skipOverwrite
in #831 / #859 causedFactory
andImpl
classes never to be written for jax-rs. this fixes that.also i noticed the old jax-rs templates have bad spacing, e.g.
this aligns things and generally improves whitespace (superseding #1092 as per @wing328 's comment)