swagger如何显示子类的结构自动注解

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
import io.swagger.annotations.ApiModel;
@ApiModel(subTypes = {SubClass.class})
class BaseClass {
...
}
import io.swagger.annotations.ApiModel; @ApiModel(subTypes = {SubClass.class}) class BaseClass { ... }
import io.swagger.annotations.ApiModel;
@ApiModel(subTypes = {SubClass.class})
class BaseClass {
...
}

 

2 thoughts on “swagger如何显示子类的结构自动注解

  1. tristan

    这个subTypes主要起什么作用,我现在有个接口用了策略模式,接口的返回值类型是父类,怎么才能把实际返回的子类的结构也放到swagger呢?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *