Просто интересно, как упростить этот следующий код, вставляющий его вручную в код, сгенерированный Swagger?
// Check some interface handler is defined;
// tell to the developer it not implemented once it's false
if api.AccountsGetAccountsProviderHandler == nil {
api.AccountsGetAccountsProviderHandler = accounts.GetAccountsProviderHandlerFunc(func(params accounts.GetAccountsProviderParams) middleware.Responder {
return middleware.NotImplemented("operation accounts.GetAccountsProvider has not yet been implemented")
})
}
if api.NetworkGetNetworkProviderRegionCidrallocationsHandler == nil {
api.NetworkGetNetworkProviderRegionCidrallocationsHandler = network.GetNetworkProviderRegionCidrallocationsHandlerFunc(func(params network.GetNetworkProviderRegionCidrallocationsParams) middleware.Responder {
return middleware.NotImplemented("operation network.GetNetworkProviderRegionCidrallocations has not yet been implemented")
})
}
if api.PodGetPodTenantHandler == nil {
api.PodGetPodTenantHandler = pod.GetPodTenantHandlerFunc(func(params pod.GetPodTenantParams) middleware.Responder {
return middleware.NotImplemented("operation pod.GetPodTenant has not yet been implemented")
})
}
....
// 5000 similar lines