@@ -58,30 +58,44 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
5858 public static final String USE_ES6 = "useES6" ;
5959 public static final String NPM_REPOSITORY = "npmRepository" ;
6060 public static final String USE_URL_SEARCH_PARAMS = "useURLSearchParams" ;
61+ public static final String SKIP_DEFAULT_USER_AGENT = "skipDefaultUserAgent" ;
6162
6263 public static final String LIBRARY_JAVASCRIPT = "javascript" ;
6364 public static final String LIBRARY_APOLLO = "apollo" ;
6465
65- @ Setter protected String projectName ;
66- @ Setter protected String moduleName ;
67- @ Setter protected String projectDescription ;
68- @ Setter protected String projectVersion ;
69- @ Setter protected String licenseName ;
70-
71- @ Getter @ Setter
66+ @ Setter
67+ protected String projectName ;
68+ @ Setter
69+ protected String moduleName ;
70+ @ Setter
71+ protected String projectDescription ;
72+ @ Setter
73+ protected String projectVersion ;
74+ @ Setter
75+ protected String licenseName ;
76+
77+ @ Getter
78+ @ Setter
7279 protected String invokerPackage ;
73- @ Setter protected String sourceFolder = "src" ;
74- @ Setter protected boolean usePromises ;
75- @ Setter protected boolean emitModelMethods ;
76- @ Setter protected boolean emitJSDoc = true ;
80+ @ Setter
81+ protected String sourceFolder = "src" ;
82+ @ Setter
83+ protected boolean usePromises ;
84+ @ Setter
85+ protected boolean emitModelMethods ;
86+ @ Setter
87+ protected boolean emitJSDoc = true ;
7788 protected String apiDocPath = "docs/" ;
7889 protected String modelDocPath = "docs/" ;
7990 protected String apiTestPath = "api/" ;
8091 protected String modelTestPath = "model/" ;
8192 protected boolean useES6 = true ; // default is ES6
82- @ Setter protected String npmRepository = null ;
83- @ Getter private String modelPropertyNaming = "camelCase" ;
84- @ Setter protected boolean useURLSearchParams = true ;
93+ @ Setter
94+ protected String npmRepository = null ;
95+ @ Getter
96+ private String modelPropertyNaming = "camelCase" ;
97+ @ Setter
98+ protected boolean useURLSearchParams = true ;
8599
86100 public JavascriptClientCodegen () {
87101 super ();
@@ -196,6 +210,9 @@ public JavascriptClientCodegen() {
196210 "use JS build-in UrlSearchParams, instead of deprecated npm lib 'querystring'" )
197211 .defaultValue (Boolean .TRUE .toString ())
198212 );
213+ cliOptions .add (new CliOption (SKIP_DEFAULT_USER_AGENT ,
214+ "Skip setting default user-agent in ApiClient.js" )
215+ .defaultValue (Boolean .FALSE .toString ()));
199216
200217 supportedLibraries .put (LIBRARY_JAVASCRIPT , "JavaScript client library" );
201218 supportedLibraries .put (LIBRARY_APOLLO , "Apollo REST DataSource" );
@@ -1186,7 +1203,7 @@ public void postProcessFile(File file, String fileType) {
11861203
11871204 // only process files with js extension
11881205 if ("js" .equals (FilenameUtils .getExtension (file .toString ()))) {
1189- this .executePostProcessor (new String [] {jsPostProcessFile , file .toString ()});
1206+ this .executePostProcessor (new String []{jsPostProcessFile , file .toString ()});
11901207 }
11911208 }
11921209
0 commit comments