Skip to content

Support for DeferredResult  #804

Closed
Closed
@nk-rks

Description

@nk-rks

My server supports asynchronous Servlet processing, so it returns entities of type DeferredResult.
DeferredResult is a special type which the Servelet recognizes, and extracts from it the type referenced in the DeferredResult definition.

e.g. The pojo is defined with a member of type DeferredResult, and the actual entity returned by the Servlet to the end-user is the type referenced in the DeferredResult definition, e.g. ActualReturnedEntity.

The problem is that sprindoc documents the DeferredResult as DeferredResultActualReturnedEntity.
The expectation is for sprindoc to document the referenced entity: ActualReturnedEntity

There was a similar issue with springfox: springfox/springfox#346

spring-boot: 2.0.3
springdoc-openapi: 1.4.3

Sample server code:

@ApiResponses({@ApiResponse(responseCode = "200")})
public @ResponseBody DeferredResult<OperationResponse<ActualReturnedEntity>> update(
  @RequestBody ActualReturnedEntity entity) throws Exception {
	return null;
}

Actual result:

{
  "responses": {
  "200": {
    "description": "OK",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/DeferredResultOperationResponseActualReturnedEntity"
        }
    }
  }
}

Expected results:

{
  "responses": {
  "200": {
    "description": "OK",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/OperationResponseActualReturnedEntity"
        }
    }
  }
}

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