I have the following controller code:
public abstract class BaseController<TClientModel extents BaseClientModel> {
@Operation
@GetMapping
Page<TClientModel> get()
}
@Data
public abstract class BaseClientModel {
int id;
}
@RestController
public class SpecificController extends BaseController<SpecificClientModel> {}
@Data
public class SpecificClientModel extends BaseClientModel {
String name;
}
Problem: When open-api markup is generated for SpecificController in Swagger, client model in the response is BaseClientModel, not SpecificClientModel and only has id field, and not id+name.
Actual:
{
"id": 0,
}
Expected:
{
"id": 0,
"name": "string",
}
Given I have 40+ specific controllers, is there any way I can make springdoc open-api generate correct markup based on specific generic parameters?
Page<TClientModel> get()
it doesn't have a ";" in the end and neither body or abstract word. What isTClientModel
? I don't see it here I guess it'sSpecificClientModel
? With example it would be way more easy to get some answer – Eugene Kortov