mulesoft-labs / raml-java-client-generator

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

Subresource on same line generates invalid default constructor. #28

Closed ullgren closed 6 years ago

ullgren commented 6 years ago

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:
  2. Generate client code
  3. Try to compile the generated source
  4. 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.