Map<String, Model> modelMap = newHashMap();
SwaggerGlobalSettings swaggerGlobalSettings = (SwaggerGlobalSettings) context.get("swaggerGlobalSettings");
HandlerMethodResolver handlerMethodResolver
= new HandlerMethodResolver(swaggerGlobalSettings.getTypeResolver());
ResolvedType modelType = ModelUtils.handlerReturnType(swaggerGlobalSettings.getTypeResolver(), handlerMethod);
modelType = swaggerGlobalSettings.getAlternateTypeProvider().alternateFor(modelType);
ApiOperation apiOperationAnnotation = handlerMethod.getMethodAnnotation(ApiOperation.class);
if (null != apiOperationAnnotation && Void.class != apiOperationAnnotation.response()) {
modelType = asResolved(swaggerGlobalSettings.getTypeResolver(), apiOperationAnnotation.response());
}
if (!swaggerGlobalSettings.getIgnorableParameterTypes().contains(modelType.getErasedType())) {
ModelContext modelContext = ModelContext.returnValue(modelType);
markIgnorablesAsHasSeen(swaggerGlobalSettings.getTypeResolver(),
swaggerGlobalSettings.getIgnorableParameterTypes(),
modelContext);
Optional<Model> model = modelProvider.modelFor(modelContext);