Raml to Java not generating schema object for collection only resources


I’ve hit what looks like a bug with the Raml to Java generator.

I have a resource that can only ever return a collection so the schema for the individual item is Foo and the array obect returned, FooList references Foo in the schema definition.

Whilst this strategy works fine where there are also Rest resource paths for the individual items (e.g. by id) this one is only ever a list. The code generation produces a Java resource interface with “withJsonOK(List entity)” but there is no Foo model object created to populate and add to a list.

Can anyone clarify if this is a bug or if there is a workaround? I’d prefer not to add a single item “byId” resource that isn’t implemented simply to get around the problem.



It definitely looks like a bug.

QQ: what tool are you using to generate Java code?