我在 swagger-ui 中生成的输出是:
DocumentChangeSet {
deletes (Collection«DocumentKey», optional),
updates (Collection«AbstractDocument», optional)
}
Collection«DocumentKey» {}
Collection«AbstractDocument» {}
有没有办法让它更详细
deletes (Collection«DocumentKey», optional),
并
updates (Collection«AbstractDocument», optional)
全面分解这些部分?
我的案卷如下所示:
@Bean
public Docket api(){
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build()
.genericModelSubstitutes(DeferredResult.class)
.alternateTypeRules(
newRule(typeResolver.resolve(DeferredResult.class,
typeResolver.resolve(DeferredResult.class,DocumentChangeSet.class)),
DocumentChangeSet.class)
)
.pathMapping("/")
.apiInfo(apiInfo());
}
为了添加更多细节,documentKey 和 abstractDocument 都被注释了。
下面是没有任何注释的 DocumentChangeSet 类。
public DocumentChangeSet(Collection<? extends AbstractDocument> updates, Collection<DocumentKey> deletes) {
this.updates = ImmutableSet.copyOf(updates);
this.deletes = ImmutableSet.copyOf(deletes);
}
@Override
public String toString() {
return Objects.toStringHelper(this)
.add("updates", updates.size())
.add("deletes", deletes.size())
.toString();
}
public Collection<AbstractDocument> getUpdates() {
return updates;
}
public Collection<DocumentKey> getDeletes() {
return deletes;
}