Skip to content

Add support for object as request parameter container #120

Closed
@joaodias14

Description

@joaodias14

Spring supports that an object is used to define query parameters as shown below:

Controller

@RestController
public class MealPartiesAdminController {
    @GetMapping(value = "/parties/{id}")
    public MealParty getMealParty(@PathVariable("id") long mealPartyId, MealPartiesQuery query){
        return this.mealPartyAdminService.getMealParty(mealPartyId, query);
    }
}

Model

public class MealPartiesQuery {
    private String name;
    private int membersCount;
}

Both name and membersCount are now endpoint query parameters. However, the generated swagger information only shows the query as an object. I've also added @ModelAttribute to query parameter in the controller but it still shows it as an object.
Am I missing something or there is no support for this currently?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions