0

I have an api with the following path

@PutMapping("/test/{test1}/{test2}")

I am not sure how to define multiple parameters in @Operation, I only know how to describe one and from what I searched on google I didn't find anything that could help me yet.

@Operation(
        parameters = @Parameter(name = "test1",
                description = "test1"
        )
)

What I want to do is to try to add a name and a description for test2 as well.

2
  • swagger.io/docs/specification/describing-parameters does this help? Commented Dec 15, 2022 at 10:00
  • 'parameters' is an array and you can specify more than one @Parameter (enclosed within a pair of curly braces) Commented Dec 15, 2022 at 10:03

1 Answer 1

0

Here is example

@Operation(
        parameters = {
        @Parameter(name = "test1",
                description = "test1"
        ),
        @Parameter(name = "test2",
                description = "test2"
        )}
)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.