[REQ] How to adjust the file name of a generated java class?
Created by: Emdee89
I played around with creating by own custom template for Java Resttemplate. This works quite nice!
My aim is to alter the class name of the generated API classes. I did so by changing api.mustache
:
...
public class {{classVarName}} {
private ApiClient apiClient;
...
I replaced {{className}}
by {{classVarName}}
and the output is as expected.
However, Java requires that the class name and the file name are the same.
It appears that the generated Java file name is built with the variable {{className}}
.
Suppose my API is named My Service
, then the file would be named MyServiceApi.java
, and the code would be public class MyService
.
How can I alter the file name of the Java class?