Add another config option called "returnType" and inline define the structure of the object via jsonschema. Load this in via the apispec (using type object, already done!), and then pass this to the json2pojo library for generating the necessary classes. See code snippet below
<dependency>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-core</artifactId>
<version>0.4.8</version>
</dependency>
JCodeModel codeModel = new JCodeModel();
new SchemaMapper().generate(codeModel, "ClassName", "com.example", apiSpec.getReturnType);
codeModel.build(new File("output"));
Add another config option called "returnType" and inline define the structure of the object via jsonschema. Load this in via the apispec (using type object, already done!), and then pass this to the json2pojo library for generating the necessary classes. See code snippet below
JCodeModel codeModel = new JCodeModel();
new SchemaMapper().generate(codeModel, "ClassName", "com.example", apiSpec.getReturnType);
codeModel.build(new File("output"));