Closed clragon closed 2 months ago
Hi,
sorry for the late response.
I think it should be title
instead of name
.
@Schema(title = "MyModel")
data class MyModelDto(
// ...
)
Can you check if that solves the problem?
Hi, Thanks for your reply.
Unfortunately, its not title
either. The title
property only changes the display name of the Model in the Swagger UI, but the Model itself is not renamed, therefore, shows up as Dto
when later read by generators.
From what I have understood from the docs, it is meant to be name
. but it doesnt appear to work correctly.
Hi,
i misunderstood the issue. You are correct, it should be name
and it does work for nested objects but not for the root object.
Unfortunately this is not an easy fix with the current setup and how schemas are generated.
I am working on a version 3 of the plugin which should be ready to test in the next few days and should make this possible.
I hope this could be a possible solution for you.
My server has DTO models, but I would like the API to have names without the DTO suffix. Because of that, I would like to annotate the models as so:
however, this does not seem to work well with the generator:
MyModelDto
is generated and used for Responses which come frombody<MyModelDto>()
MyModel
is generated and used in other Schema's properties which come from Models containing this one, or frombody<List<MyModelDto>>