mulesoft-labs / raml-java-client-generator

Raml Java Client Generator
Apache License 2.0
34 stars 34 forks source link

Add Default Constructors #19

Closed FlorianMarsch closed 6 years ago

FlorianMarsch commented 6 years ago

Hi, please apply my pull request. I added some default Constructors to let them be providable via CDI Producers.

machaval commented 6 years ago

I think you are missing test outputs no? As your change for sure have modified some of our tests

FlorianMarsch commented 6 years ago

Hi im sorry. Did not check the tests. Have changed the resources to match generated content (added constructors where the test expects them)

FlorianMarsch commented 6 years ago

Hi, nice :) do you know when you perform the next release step?

machaval commented 6 years ago

Hi Florian I needed to revert your commit as empty constructor didn't work for how our design for resource navigation was design. The inner resources are final fields and this doesn't compile when having empty constructors. Removing the final modifier will create an invalid pattern IMHO

Regards, Mariano A.

FlorianMarsch commented 6 years ago

Hi Mariano, i dont understand your comment. There is no need to let the generated Client use the empty constructor. Your pattern of resource navigation still works by using the factory method.

The empty constructors are only needed to init proxys of the the client and the resources. Im using a raml with basic auth and don't want to provide the credentials at runtime by myself. I want the container to provide a fully created service and inject them as dependency.

The other way of providing this feature is to introduce complex generated Interfaces. but this would break your pattern even more I think