com.paas.swagger.plugin.ApiBeanMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of paas-swagger-starter Show documentation
Show all versions of paas-swagger-starter Show documentation
Custom Swagger Spring Boot Starter
The newest version!
package com.paas.swagger.plugin;
import com.google.common.collect.Multimap;
import io.swagger.models.Model;
import org.mapstruct.Mapper;
import springfox.documentation.service.ApiListing;
import springfox.documentation.swagger2.mappers.ModelMapper;
import java.util.Map;
import static com.google.common.collect.Maps.newTreeMap;
@Mapper
public class ApiBeanMapper extends ModelMapper {
Map modelsFromApiListings(Multimap apiListings) {
Map definitions = newTreeMap();
for (ApiListing each : apiListings.values()) {
definitions.putAll(each.getModels());
}
return mapModels(definitions);
}
}