This repository was archived by the owner on Dec 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
src/main/java/org/openapijsonschematools/codegen Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -255,10 +255,6 @@ public void execute() {
255255 configurator .setTemplateDir (templateDir );
256256 }
257257
258- if (isNotEmpty (packageName )) {
259- configurator .setPackageName (packageName );
260- }
261-
262258 if (isNotEmpty (templatingEngine )) {
263259 configurator .setTemplatingEngineName (templatingEngine );
264260 }
@@ -350,8 +346,20 @@ public void execute() {
350346 if (globalProperties != null && !globalProperties .isEmpty ()) {
351347 CodegenConfiguratorUtils .applyGlobalPropertiesKvpList (globalProperties , configurator );
352348 }
349+
350+ if (isNotEmpty (packageName )) {
351+ configurator .setPackageName (packageName );
352+ }
353+
353354 CodegenConfiguratorUtils .applyAdditionalPropertiesKvpList (additionalProperties , configurator );
354355
356+ if (!isNotEmpty (packageName ) && (configurator .getAdditionalProperties () != null && configurator .getAdditionalProperties ().containsKey ("packageName" ))) {
357+ // if packageName is passed as an additional property warn them
358+ System .out .println ("packageName should be passed in using --package-name from now on" );
359+ packageName = (String ) configurator .getAdditionalProperties ().get ("packageName" );
360+ configurator .setPackageName (packageName );
361+ }
362+
355363 try {
356364 final ClientOptInput clientOptInput = configurator .toClientOptInput ();
357365
Original file line number Diff line number Diff line change @@ -468,6 +468,10 @@ public Context<?> toContext() {
468468 return new Context <>(specification , generatorSettings , workflowSettings );
469469 }
470470
471+ public Map <String , Object > getAdditionalProperties () {
472+ return additionalProperties ;
473+ }
474+
471475 public ClientOptInput toClientOptInput () {
472476 Context <?> context = toContext ();
473477 WorkflowSettings workflowSettings = context .getWorkflowSettings ();
You can’t perform that action at this time.
0 commit comments