mulesoft-labs/raml-java-client-generator

NPE when full path defined twice

ktmcgrat opened this issue · 2 comments

The following raml

#%RAML 1.0
title: test
version: v1

/api/a:
get:
/api/b:
get:

Will cause the following error to be thrown.

java.lang.NullPointerException
at org.mule.client.codegen.RamlJavaClientGenerator.buildResourceClass(RamlJavaClientGenerator.java:277)
at org.mule.client.codegen.RamlJavaClientGenerator.generate(RamlJavaClientGenerator.java:191)
at org.mule.client.codegen.RamlJavaClientGenerator.generate(RamlJavaClientGenerator.java:90)
at BuildJarFromRAML.main(BuildJarFromRAML.java:33)

Because the /api path is defined twice, when processing /api/b the parent of b is not linked correctly as it knows /api already exists but doesn't set it's parent properly.

I believe this issue was fixed PR #34.

Works for me