How to change collection format when using Swagger and Spring Fox?

Viewed 335

I am using Spring Fox to generate the OpenApi 3.0 document for Swagger-ui.

With springfox-boot-starter:3.0.0

@GetMapping("/test")
public void test(TestParams testParams) {    
}

public class TestParams {
    List<String> list1;
}

When I get the json api-docs.I got this

{
    // ...
    "parameters": [
        {
            "name": "list1",
            "in": "query",
            "required": false,
            "style": "pipeDelimited", << How to modify this to simple?
            "schema": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            }
        }
    ]
    // ...
}

Now I need comma separator for this query field, not pipe separator. See https://swagger.io/docs/specification/serialization/

So How to modify the style 'pipeDelimited' to 'simple'? Thanks for help!

0 Answers
Related