Skip to content

How to add the json request body in swagger ui (for java code, possibly using annotations)? #1383

@wakandan

Description

@wakandan

I'm writing a dropwizard app. I want to have something similar to this
result

but what I'm having is only this (it doesn't have the json request body text form)
rightnow

my annotations are like these

    @POST
    @UnitOfWork
    @Consumes(MediaType.APPLICATION_JSON)
    @ApiOperation(value = "Create a new shop", response = long.class, consumes="application/json")
    @ApiResponses(value = {
            @ApiResponse(code = 406, message = R.ERROR_SHOP_NAME_EXISTED),
            @ApiResponse(code = 404, message = R.ERROR_USER_NOT_FOUND),
            @ApiResponse(code = 201, message = "shop id") })
    public Response create(Shop shop) {

How do I make it work like the first picture? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions