Closed
Description
Describe the bug
With upgrade from 2.6.0
to 2.7.0
we experience unexpected changes to generated schema - Unit
Kotlin return type appears in the schema.
To Reproduce
Consider Spring REST Controller method like this:
@PostMapping("{token}/activate")
@ResponseStatus(HttpStatus.NO_CONTENT)
suspend fun activateUser(
@PathVariable token: String,
@RequestBody @Valid request: UserActivationRequestDto
) {
...
In 2.6.0
, the schema was generated correctly, in our opinion:
/api/user-activation-tokens/{token}/activate:
post:
...
responses:
"204":
description: No Content
In 2.7.0
, however, the extra type is generated:
/api/user-activation-tokens/{token}/activate:
post:
...
responses:
"204":
description: No Content
content:
application/json:
schema:
$ref: "#/components/schemas/Unit"
...
components:
schemas:
Unit:
type: object
Additional context
As a side note, we are using OpenApiGenerator to generate TypeScript client from the OpenAPI schema, and now the client code has method return types object
instead of previous void
.
Metadata
Metadata
Assignees
Labels
No labels