-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
javaType : generate classes in subpackage of the target package #1089
Comments
I realize this has already been suggested here: #195 (comment) |
#195 (comment) has been marked as closed by #1054, which was merged into master on Dec 12, 2019, while release 1.0.2 is from Jan 27, 2020. Yet I get the same behavior whether I specify javaType= What am I missing? |
(sorry for the monologue...) |
What prevents you from declaring your javaType to be com.example.bar.Foo? I guess this is just an enhancement request? |
Nothing, and that would work, but I shouldn't have to use |
Thanks @ogerardin. I have reopened #195. |
Suppose I generate my classes in target package
com.example
.If I specify a
javaType
property ofFoo
, it will be generated ascom.example.Foo
, as expected.However if I specify a
javaType
property ofbar.Foo
(with a dot), it will be generated asbar.Foo
(i.e. in packagebar
).To me it would make more sense to generate it in package
com.example.bar.Foo
, i.e. a subpackage of the target package. As it is now, if I want to generate classes in subpackages of the target package, I have to repeat the fully qualified package name in everyjavaType
property. And of course if I want to change it I will have to change in all the places it is referenced...If we want to preserve this behavior for compatibility and still allow generating classes in subpackages, I suggest we introduce the convention that if the javaType begins with a dot, it's considered relative to the target package.
For example:
bar.Foo
-> generates classbar.Foo
(same as current behavior).bar.Foo
-> generates classcom.example.bar.Foo
What do you think?
The text was updated successfully, but these errors were encountered: