All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.paas.swagger.plugin.ApiBeanMapper Maven / Gradle / Ivy

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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy