mulesoft-labs/raml-java-client-generator

Subresource on same line generates invalid default constructor.

Closed this issue · 0 comments

Describe the bug
When a resource with a sub-resource is defined on the same line the default constructor of the parent resource class does not properly initialize the sub-resource.

To Reproduce
Steps to reproduce the behavior:

  1. Create a RAML that contains the following resource definition.
/projects/rename:
      put:
        description: Rename a project
        body:
          #schema: projectName
        responses:
          202:
          404:
  1. Generate client code
  2. Try to compile the generated source
  3. There is a error The blank final field rename may not have been initialized on the default constructor for the projects resource class (resource/projects/Projects.java).

Expected behavior
The subresource attribute should be initialized to null in the default constructor as is the case when defining the subresource on a second line.