guardrail-dev / guardrail-dev/guardrail
Value from x-jvm-package included in Handler and Resource name
- Dominant language
- Scala
- Stars
- 541
- Forks
- 138
- PR merge metrics
- No merged PRs in 30d
Description
`x-jvm-package` is a very useful feature for splitting up routes and handlers, but the generated names of the `Handler` trait and `Resource` object seem redundant.
Assuming package `foo` is specified at the build tool level, without `x-jvm-package` specified, `foo.Handler` and `foo.Resource` are generated. This is good. But when `x-jvm-package: bar` is added, `foo.bar.BarHandler` and `foo.bar.BarResource` are generated. Since the option is for package naming, seems like it should be `foo.bar.Handler` and `foo.bar.Resource`. The latter would also make for more consistent code that's easier to change when `x-jvm-package` is changed.
Things get even worse if you specify `x-jvm-package: bar.baz`: `foo.bar.baz.BarbazHandler` and `foo.bar.baz.BarbazResource` are pretty ugly names.
I could take a crack at fixing this if the change sounds good?
Contributor guide
Assessment
This issue has not been assessed yet.