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

How to call generator with deprecated D arguments? #5681

Closed
Pe-te opened this issue Mar 23, 2020 · 5 comments · Fixed by #5687
Closed

How to call generator with deprecated D arguments? #5681

Pe-te opened this issue Mar 23, 2020 · 5 comments · Fixed by #5687

Comments

@Pe-te
Copy link
Contributor

Pe-te commented Mar 23, 2020

Hi folks, when I run the following command:

export JAVA_OPTS="${JAVA_OPTS} -Dlog.level=warn"
openapi-generator generate -g kotlin -D models -D apis --library jvm-retrofit2 -i "${YAML_FILE}" -o "${KOTLIN_PATH}" --additional-properties=serializationLibrary=gson

I get this deprecation message:

[DEPRECATED] -D arguments after 'generate' are application arguments and not Java System Properties, please consider changing to -p, or apply your options to JAVA_OPTS, or move the -D arguments before the jar option.

I tried different combinations and positions and couldn't get rid of it. What would be the correct way to call the generator?

macOS, homebrew, openapi-generator 4.2.3

@auto-labeler
Copy link

auto-labeler bot commented Mar 23, 2020

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@jimschubert
Copy link
Member

@Pe-te sorry, that message was intended for users who used -D to pass system properties. It wasn't very clear for users using it for -Dapis or other "global properties" like you have.

I've opened #5687 to add --global-property as the long form alongside the -D short property. This should clear up usage as well as finalizing the removal of confusing around the -D property, which is slated for removal in 5.0.

@Pe-te
Copy link
Contributor Author

Pe-te commented Mar 24, 2020

Thanks for the quick reply!

I'm just still a little confused what I should do now:

  • Is it okay/correct to use the -D until the --global-property is implemented or do I need a different mechanism to pass the api and model parameters?

  • Could the --global-property also somehow be used to set the log level so we don't need to modify the JAVA_OPTS? or is this possible somehow else?

@jimschubert
Copy link
Member

@Pe-te The log level can only be set as a Java System Property, so it'll need to stay the same.

You can continue using the -D for generator global properties like apis and models until the change is released in 4.3.0, this will give you time to switch before -D is removed in 5.0.

@Pe-te
Copy link
Contributor Author

Pe-te commented Mar 24, 2020

Okay, I see. Thanks again!

@Pe-te Pe-te closed this as completed Mar 24, 2020
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.

2 participants