lagom / sbt-lagom-descriptor-generator

Lagom API code generator
Apache License 2.0
23 stars 12 forks source link

Parameterize output package name #24

Open ignasi35 opened 7 years ago

ignasi35 commented 7 years ago

Current sbt plugin will output code into a package equal to the organization name of the sbt project. This value should be overridable by the end user.

See https://github.com/lagom/sbt-lagom-descriptor-generator/blob/070a71d207a2c5b1888ced3c7fd4e3a22536b379/lagom-descriptor-generator-sbt-plugin/src/main/scala/com/lightbend/lagom/spec/sbt/LagomOpenApiGenerator.scala#L36-L36

ignasi35 commented 7 years ago

This is closely related to #25 since a user consuming several service may want to create their APIs in separate packages. Imagine an app consuming twitter, slack and G+ APIs and all three have an Error type in their definitions, without a package-per-service there would be a collision and client code would be confusing.

ignasi35 commented 7 years ago

This could be achieved by either including a lagomGeneratorPackageName parameter in the sbt plugin or via allowing users to implement a Service => Service function in their sbt settings and have that injected in the provided generators.