Skip to content

The response scheme is erased with the generic void type #555

Closed
@Birthright50

Description

@Birthright50

I use spring boot 2.2.6, springdoc 1.3.1.
For example there is an endpoint:

    @PutMapping(Routes.CMS.Internal.CONTENT)
    public ActionResult<Void> update(@Validated @RequestBody UpdateContentRequest request) {
        this.contentService.update(request);
        return ActionResult.ok();
    }

For any response i has wrapper ActionResult:

public class ActionResult<T> {

    protected T value;
    protected boolean success;
    protected ServiceEnum service;
    protected String errorCode;
    protected String message;
    protected Object errorValue;
    protected String targetUrl;
}

and if I specify the generic Void type, swagger generates response without schema:

        "responses": {
          "200": {
            "description": "default response"
          }
        }

but with ? type or without specify generic type:

        "responses": {
          "200": {
            "description": "default response",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResult"
                }
              }
            }
          }
        }

With springfox i had no problems, an ActionResultVoid scheme was generated, but it is simply empty here.

As I understand the problem is here
Why are Void types excluded here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions