SmallRye OpenAPI includes coroutine context in schema
See original GitHub issueDescribe the bug
When using the quarkus-smallrye-openapi
extension with routes that use suspend fun
(Kotlin coroutines), the generated OpenAPI specification will show coroutine continuations (ContinuationSuperResponse
or ContinuationSuperList
) as the request body schema.
OpenAPI sample (click to expand)
---
openapi: 3.0.3
info:
title: quarkus-kotlin-quickstart API
version: 1.0.0-SNAPSHOT
paths:
/fruits:
get:
tags:
- Fruit Resource
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ContinuationSuperList'
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Fruit'
post:
tags:
- Fruit Resource
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Fruit'
responses:
"200":
description: OK
/fruits/{id}:
get:
tags:
- Fruit Resource
parameters:
- name: id
in: path
required: true
schema:
format: int64
type: integer
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ContinuationSuperResponse'
responses:
"200":
description: OK
delete:
tags:
- Fruit Resource
parameters:
- name: id
in: path
required: true
schema:
format: int64
type: integer
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ContinuationSuperResponse'
responses:
"200":
description: OK
components:
schemas:
ContinuationSuperList:
type: object
properties:
context:
$ref: '#/components/schemas/CoroutineContext'
ContinuationSuperResponse:
type: object
properties:
context:
$ref: '#/components/schemas/CoroutineContext'
CoroutineContext:
type: object
Fruit:
type: object
properties:
id:
format: int64
type: integer
name:
type: string
Expected behavior
The internal continuation classes to be excluded from the generated schema.
Actual behavior
The response schema is a continuation:
paths:
/fruits:
get:
tags:
- Fruit Resource
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ContinuationSuperList'
How to Reproduce?
Run https://github.com/rgmz/quarkus-kotlin-openapi-21509 and visit http://localhost:8080/q/openapi
Output of uname -a
or ver
No response
Output of java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.4.2.Final
Build tool (ie. output of mvnw --version
or gradlew --version
)
No response
Additional information
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:10 (8 by maintainers)
Top Results From Across the Web
MicroProfile OpenAPI for everyone - Quarkus
In this blog post we will look at how the SmallRye Implementation extends this with some extra features, and support for more web...
Read more >Kotlin coroutines integration - SmallRye Mutiny
The module mutiny-kotlin provides an integration with Kotlin coroutines. There are currently four extension methods available for converting between Mutiny and ...
Read more >Kickstart your first Quarkus application | by Hantsy - Medium
SmallRye Context Propagation quarkus-smallrye-context-propagation ... Unfortunately, the CommentResource is not included in the generated OpenAPI schema, ...
Read more >IntelliJ IDEA 2021.3 - ComponentSource
IntelliJ IDEA has a helpful option that allows you to preview the results of intention actions and quick-fixes before applying them to your...
Read more >Table of Contents - OpenAPI/Swagger Support
Micronaut includes support for producing OpenAPI (Swagger) YAML at ... In micronaut configuration file you can define a server context path (with ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fix incorporated with #21813
We are having the same problem, could please say whenever it is resolved?