-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
select Generator by language|framework|type composite key #885
Conversation
* Improve handling of all primitive types * Fix missing includes in case of simple APIs * Fix minor error in template function * Remove tabs * Refactor code for simplicity * Remove tabs * rework the router for handling multiple path param * rework router to handle multiple path parameters * rework router to handle multiple path parameters * rework router * Add support for Multi path param * Add comments to code block and remove duplicate parameters * Remove tabs :( * Add missing imports after resolving conflict
…PITools#876) Simplify other scripts needing this jar Consistent with openapi-generator-cli
a381990
to
ea66c10
Compare
…enAPITools#775) * Remove using model namespace when model is unused * Add comments to clarify introduction of hasModelImport at API/operations level instead of operation/vendorExtensions level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've only done a very quick glance. I wanted to leave the comments I had this far in order to start any conversation. I've had a full week, and today is my son's 2nd birthday, so I'll try to revisit more in depth over the next few days.
@@ -397,14 +397,17 @@ SYNOPSIS | |||
[(-c <configuration file> | --config <configuration file>)] | |||
[-D <system properties>...] | |||
[(-g <generator name> | --generator-name <generator name>)] | |||
[(-lang <language>)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like these may have been added manually?
This should follow
- single hyphen followed by single character for short options
- double hyphen followed by kebab case phrase for long options
This table part of docs can be copied from the cli's help
output
@@ -27,6 +27,6 @@ fi | |||
|
|||
# if you've executed sbt assembly previously it will use that instead. | |||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" | |||
ags="generate --artifact-id "scala-akka-petstore-client" -t modules/openapi-generator/src/main/resources/scala-akka-client -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g akka-scala -o samples/client/petstore/scala-akka $@" | |||
ags="generate --artifact-id "scala-akka-petstore-client" -t modules/openapi-generator/src/main/resources/scala-akka-client -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-akka -o samples/client/petstore/scala-akka $@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not be flipping the standardized generator name structures. This was already done for 3.0, and any additional changes are intended to wait for this options split to be completed.
@@ -48,10 +46,18 @@ | |||
@Option(name = {"-v", "--verbose"}, description = "verbose mode") | |||
private Boolean verbose; | |||
|
|||
@Option(name = {"-l", "--lang"}, title = "language", | |||
description = "client language to generate (maybe class name in classpath, required)") | |||
@Option(name = {"-lang"}, title = "language", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These long name options should have double hyphen to match all other options formats
@@ -18,6 +23,18 @@ | |||
@Option(name = {"-s", "--short" }, description = "shortened output (suitable for scripting)") | |||
private Boolean shortened = false; | |||
|
|||
@Option(name = {"-lang"}, title = "language", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use double hyphen for long names
*/ | ||
@Parameter(name = "language") | ||
@Parameter(name = "generatorLanguage") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these all prefixed with generator
while CLI options are not? Is there some Maven key conflict?
@@ -30,7 +30,7 @@ | |||
private static Map<String, CodegenType> names = new HashMap<String, CodegenType>(); | |||
|
|||
@JsonCreator | |||
public static CodegenType forValue(String value) { | |||
public static CodegenType fromString(String value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid changing APIs like this unless there's good reason. This will be a breaking change for those consuming the project programmatically (such as my intellij-openapi-generator).
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,3.3.x
,4.0.x
. Default:master
.@jmini @jimschubert
Description of the PR
implementation prototype for #137 to select a given generator either by generatorName as it is now, or alternatively select it by language|framework|type, and error out when there is an ambiguity.