0
votes

i'm using swagger 2.5.0 with spring boot to generate a api doc. I have configured a global header parameter like this:

myDocket.globalOperationParameters(return Arrays.asList(
        new ParameterBuilder()
            .name("version")
            .description("Version of the api. Starting with 1.")
            .modelRef(new ModelRef("integer"))
            .parameterType("path")
            .defaultValue("1")
            .required(true)
            .build()))

The problem is, that it generate this apidoc.json:

...."parameters":[{"name":"version","in":"path","description":"Version of the api. Starting with 1.","required":true,"type":"ref","default":"1"}],.....

The problem is the "type":"ref" . Swagger editor says that this is invalid.

How can i get swagger to generate "type":"string" ???

1

1 Answers

0
votes

Update the .modelRef(new ModelRef("integer")) to .modelRef(new ModelRef("string")).