quarkus: Quarkus 2.0.0 with resteasy-reactive and kotlin produces invalid OpenAPI schemas

Describe the bug

We are using Quarkus 2.0.0 internally and would like to switch to using the Kotlin coroutine support built into quarkus-resteasy-reactive. However the OpenAPI schema generated from the REST methods seem to add a coroutineContext value to the request.

A simple resource like

@Path("/hello")
class ReactiveGreetingResource {

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    suspend fun hello(): String {
        return "Hello RESTEasy Reactive"
    }
}

produces the following OpenAPI spec

---
openapi: 3.0.3
info:
  title: Generated API
  version: "1.0"
paths:
  /hello:
    get:
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContinuationSuperString'
      responses:
        "200":
          description: OK
          content:
            text/plain:
              schema:
                type: object
components:
  schemas:
    ContinuationSuperString:
      type: object
      properties:
        context:
          $ref: '#/components/schemas/CoroutineContext'
    CoroutineContext:
      type: object

Getting rid of the suspend modifier produces the proper OpenAPI result.

Expected behavior

To produce an OpenAPI spec without any coroutineContext info in the incoming payload

Actual behavior

Each REST method that does not specify a request body has a ContinuationSuper* objects added by default as the request body value.

To Reproduce

Steps to reproduce the behavior:

  1. Add resteasy-reactive, and openapi to your project
  2. Create a suspending Kotlin resource method
  3. Download/view the resultant OpenAPI yaml file

code-with-quarkus.zip

Configuration

Screenshots

(If applicable, add screenshots to help explain your problem.)

Environment (please complete the following information):

Output of uname -a or ver

Darwin 6.local 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64

Output of java -version

java version “11.0.6” 2020-01-14 LTS Java™ SE Runtime Environment 18.9 (build 11.0.6+8-LTS) Java HotSpot™ 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)

GraalVM version (if different from Java)

Quarkus version or git rev

2.0.0

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 6.8.3

Additional context

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 6
  • Comments: 16 (10 by maintainers)

Most upvoted comments

Fixed in 2.5.1.Final

@cogman - would you mind opening an issue in SmallRye OpenAPI with sample Kotlin code?