Map object in swagger

1.7k Views Asked by At

I am trying to create a map object in swagger

definitions:
  foo:
   description: a sample class
   required: 
    - param
   properties:
    param:
     type: object
     description: this param is a map<String, Object> where object is a derivative of java.lang.object
     additionalproperties: 
       type: object

Swagger is generating the clent stub with the below code

public class foo  {
 private Map<String, Object> param = new HashMap<String, Object>();
 getters();
 setters();
}

but it is also generating a unused and unreferenced import statement

import io.swagger.model.Object;

I am trying to generate the client stub for jax-rs API using the below statement

java -jar "../swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" generate -i /../src/main/resources/swagger/swagger.yaml -l jaxrs -o sample

Please do tell me if I am doing it right to create a Map where Object is a reference to Java.lang class

0

There are 0 best solutions below