diff --git a/configure_data_plane.go b/configure_data_plane.go index d3d06122..ad12de0a 100644 --- a/configure_data_plane.go +++ b/configure_data_plane.go @@ -56,7 +56,7 @@ import ( "github.com/haproxytech/dataplaneapi/operations" "github.com/haproxytech/dataplaneapi/operations/discovery" "github.com/haproxytech/dataplaneapi/operations/specification" - "github.com/haproxytech/dataplaneapi/operations/specification_openapiv3" + "github.com/haproxytech/dataplaneapi/operations/version3" "github.com/haproxytech/dataplaneapi/rate" // import various crypting algorithms @@ -749,12 +749,12 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m api.StorageReplaceStorageGeneralFileHandler = &handlers.StorageReplaceStorageGeneralFileHandlerImpl{Client: client, ReloadAgent: ra} // setup OpenAPI v3 specification handler - api.SpecificationOpenapiv3GetOpenapiv3SpecificationHandler = specification_openapiv3.GetOpenapiv3SpecificationHandlerFunc(func(params specification_openapiv3.GetOpenapiv3SpecificationParams, principal interface{}) middleware.Responder { + api.Version3GetOpenapiv3SpecificationHandler = version3.GetOpenapiv3SpecificationHandlerFunc(func(params version3.GetOpenapiv3SpecificationParams, principal interface{}) middleware.Responder { v2 := openapi2.T{} err = v2.UnmarshalJSON(SwaggerJSON) if err != nil { e := misc.HandleError(err) - return specification_openapiv3.NewGetOpenapiv3SpecificationDefault(int(*e.Code)).WithPayload(e) + return version3.NewGetOpenapiv3SpecificationDefault(int(*e.Code)).WithPayload(e) } // if host is empty(dynamic hosts), server prop is empty, @@ -768,9 +768,9 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler { //nolint:cyclop,m v3, err = openapi2conv.ToV3(&v2) if err != nil { e := misc.HandleError(err) - return specification_openapiv3.NewGetOpenapiv3SpecificationDefault(int(*e.Code)).WithPayload(e) + return version3.NewGetOpenapiv3SpecificationDefault(int(*e.Code)).WithPayload(e) } - return specification_openapiv3.NewGetOpenapiv3SpecificationOK().WithPayload(v3) + return version3.NewGetOpenapiv3SpecificationOK().WithPayload(v3) }) // TODO: do we need a ReloadAgent for SPOE diff --git a/operations/acl/get_acl.go b/operations/acl/get_acl.go index 0eb694ab..42205754 100644 --- a/operations/acl/get_acl.go +++ b/operations/acl/get_acl.go @@ -153,6 +153,11 @@ func (o *GetACLOKBody) ContextValidate(ctx context.Context, formats strfmt.Regis func (o *GetACLOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAclOK" + "." + "data") diff --git a/operations/backend/get_backend.go b/operations/backend/get_backend.go index 10c81a9c..76119408 100644 --- a/operations/backend/get_backend.go +++ b/operations/backend/get_backend.go @@ -153,6 +153,11 @@ func (o *GetBackendOKBody) ContextValidate(ctx context.Context, formats strfmt.R func (o *GetBackendOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getBackendOK" + "." + "data") diff --git a/operations/backend_switching_rule/get_backend_switching_rule.go b/operations/backend_switching_rule/get_backend_switching_rule.go index a3b901a0..bf30a699 100644 --- a/operations/backend_switching_rule/get_backend_switching_rule.go +++ b/operations/backend_switching_rule/get_backend_switching_rule.go @@ -153,6 +153,11 @@ func (o *GetBackendSwitchingRuleOKBody) ContextValidate(ctx context.Context, for func (o *GetBackendSwitchingRuleOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getBackendSwitchingRuleOK" + "." + "data") diff --git a/operations/bind/get_bind.go b/operations/bind/get_bind.go index 81f5fcac..042e5ac8 100644 --- a/operations/bind/get_bind.go +++ b/operations/bind/get_bind.go @@ -153,6 +153,11 @@ func (o *GetBindOKBody) ContextValidate(ctx context.Context, formats strfmt.Regi func (o *GetBindOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getBindOK" + "." + "data") diff --git a/operations/cache/get_cache.go b/operations/cache/get_cache.go index 063d816d..82ea88b8 100644 --- a/operations/cache/get_cache.go +++ b/operations/cache/get_cache.go @@ -153,6 +153,11 @@ func (o *GetCacheOKBody) ContextValidate(ctx context.Context, formats strfmt.Reg func (o *GetCacheOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getCacheOK" + "." + "data") diff --git a/operations/data_plane_api.go b/operations/data_plane_api.go index fe81f0de..17f47f9d 100644 --- a/operations/data_plane_api.go +++ b/operations/data_plane_api.go @@ -77,7 +77,6 @@ import ( "github.com/haproxytech/dataplaneapi/operations/service_discovery" "github.com/haproxytech/dataplaneapi/operations/sites" "github.com/haproxytech/dataplaneapi/operations/specification" - "github.com/haproxytech/dataplaneapi/operations/specification_openapiv3" "github.com/haproxytech/dataplaneapi/operations/spoe" "github.com/haproxytech/dataplaneapi/operations/spoe_transactions" "github.com/haproxytech/dataplaneapi/operations/stats" @@ -91,6 +90,7 @@ import ( "github.com/haproxytech/dataplaneapi/operations/transactions" "github.com/haproxytech/dataplaneapi/operations/user" "github.com/haproxytech/dataplaneapi/operations/userlist" + "github.com/haproxytech/dataplaneapi/operations/version3" ) // NewDataPlaneAPI creates a new DataPlane instance @@ -685,8 +685,8 @@ func NewDataPlaneAPI(spec *loads.Document) *DataPlaneAPI { StorageGetOneStorageSSLCertificateHandler: storage.GetOneStorageSSLCertificateHandlerFunc(func(params storage.GetOneStorageSSLCertificateParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation storage.GetOneStorageSSLCertificate has not yet been implemented") }), - SpecificationOpenapiv3GetOpenapiv3SpecificationHandler: specification_openapiv3.GetOpenapiv3SpecificationHandlerFunc(func(params specification_openapiv3.GetOpenapiv3SpecificationParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation specification_openapiv3.GetOpenapiv3Specification has not yet been implemented") + Version3GetOpenapiv3SpecificationHandler: version3.GetOpenapiv3SpecificationHandlerFunc(func(params version3.GetOpenapiv3SpecificationParams, principal interface{}) middleware.Responder { + return middleware.NotImplemented("operation version3.GetOpenapiv3Specification has not yet been implemented") }), PeerEntryGetPeerEntriesHandler: peer_entry.GetPeerEntriesHandlerFunc(func(params peer_entry.GetPeerEntriesParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation peer_entry.GetPeerEntries has not yet been implemented") @@ -1473,8 +1473,8 @@ type DataPlaneAPI struct { StorageGetOneStorageMapHandler storage.GetOneStorageMapHandler // StorageGetOneStorageSSLCertificateHandler sets the operation handler for the get one storage s s l certificate operation StorageGetOneStorageSSLCertificateHandler storage.GetOneStorageSSLCertificateHandler - // SpecificationOpenapiv3GetOpenapiv3SpecificationHandler sets the operation handler for the get openapiv3 specification operation - SpecificationOpenapiv3GetOpenapiv3SpecificationHandler specification_openapiv3.GetOpenapiv3SpecificationHandler + // Version3GetOpenapiv3SpecificationHandler sets the operation handler for the get openapiv3 specification operation + Version3GetOpenapiv3SpecificationHandler version3.GetOpenapiv3SpecificationHandler // PeerEntryGetPeerEntriesHandler sets the operation handler for the get peer entries operation PeerEntryGetPeerEntriesHandler peer_entry.GetPeerEntriesHandler // PeerEntryGetPeerEntryHandler sets the operation handler for the get peer entry operation @@ -2362,8 +2362,8 @@ func (o *DataPlaneAPI) Validate() error { if o.StorageGetOneStorageSSLCertificateHandler == nil { unregistered = append(unregistered, "storage.GetOneStorageSSLCertificateHandler") } - if o.SpecificationOpenapiv3GetOpenapiv3SpecificationHandler == nil { - unregistered = append(unregistered, "specification_openapiv3.GetOpenapiv3SpecificationHandler") + if o.Version3GetOpenapiv3SpecificationHandler == nil { + unregistered = append(unregistered, "version3.GetOpenapiv3SpecificationHandler") } if o.PeerEntryGetPeerEntriesHandler == nil { unregistered = append(unregistered, "peer_entry.GetPeerEntriesHandler") @@ -3571,7 +3571,7 @@ func (o *DataPlaneAPI) initHandlerCache() { if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } - o.handlers["GET"]["/specification_openapiv3"] = specification_openapiv3.NewGetOpenapiv3Specification(o.context, o.SpecificationOpenapiv3GetOpenapiv3SpecificationHandler) + o.handlers["GET"]["/specification_openapiv3"] = version3.NewGetOpenapiv3Specification(o.context, o.Version3GetOpenapiv3SpecificationHandler) if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } @@ -4073,6 +4073,6 @@ func (o *DataPlaneAPI) AddMiddlewareFor(method, path string, builder middleware. } o.Init() if h, ok := o.handlers[um][path]; ok { - o.handlers[method][path] = builder(h) + o.handlers[um][path] = builder(h) } } diff --git a/operations/declare_capture/get_declare_capture.go b/operations/declare_capture/get_declare_capture.go index dd9c832f..f97adc31 100644 --- a/operations/declare_capture/get_declare_capture.go +++ b/operations/declare_capture/get_declare_capture.go @@ -153,6 +153,11 @@ func (o *GetDeclareCaptureOKBody) ContextValidate(ctx context.Context, formats s func (o *GetDeclareCaptureOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getDeclareCaptureOK" + "." + "data") diff --git a/operations/defaults/get_defaults.go b/operations/defaults/get_defaults.go index e441a2be..db0ae1e9 100644 --- a/operations/defaults/get_defaults.go +++ b/operations/defaults/get_defaults.go @@ -153,6 +153,11 @@ func (o *GetDefaultsOKBody) ContextValidate(ctx context.Context, formats strfmt. func (o *GetDefaultsOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getDefaultsOK" + "." + "data") diff --git a/operations/defaults/get_defaults_section.go b/operations/defaults/get_defaults_section.go index c147785c..2fae0d27 100644 --- a/operations/defaults/get_defaults_section.go +++ b/operations/defaults/get_defaults_section.go @@ -153,6 +153,11 @@ func (o *GetDefaultsSectionOKBody) ContextValidate(ctx context.Context, formats func (o *GetDefaultsSectionOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getDefaultsSectionOK" + "." + "data") diff --git a/operations/dgram_bind/get_dgram_bind.go b/operations/dgram_bind/get_dgram_bind.go index 395be52a..870fe416 100644 --- a/operations/dgram_bind/get_dgram_bind.go +++ b/operations/dgram_bind/get_dgram_bind.go @@ -153,6 +153,11 @@ func (o *GetDgramBindOKBody) ContextValidate(ctx context.Context, formats strfmt func (o *GetDgramBindOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getDgramBindOK" + "." + "data") diff --git a/operations/fcgi_app/get_fcgi_app.go b/operations/fcgi_app/get_fcgi_app.go index 15b0baa1..f87a594e 100644 --- a/operations/fcgi_app/get_fcgi_app.go +++ b/operations/fcgi_app/get_fcgi_app.go @@ -153,6 +153,11 @@ func (o *GetFCGIAppOKBody) ContextValidate(ctx context.Context, formats strfmt.R func (o *GetFCGIAppOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getFcgiAppOK" + "." + "data") diff --git a/operations/filter/get_filter.go b/operations/filter/get_filter.go index 08879e03..2b7173f0 100644 --- a/operations/filter/get_filter.go +++ b/operations/filter/get_filter.go @@ -153,6 +153,11 @@ func (o *GetFilterOKBody) ContextValidate(ctx context.Context, formats strfmt.Re func (o *GetFilterOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getFilterOK" + "." + "data") diff --git a/operations/frontend/get_frontend.go b/operations/frontend/get_frontend.go index 8e4cbabc..1aa6c347 100644 --- a/operations/frontend/get_frontend.go +++ b/operations/frontend/get_frontend.go @@ -153,6 +153,11 @@ func (o *GetFrontendOKBody) ContextValidate(ctx context.Context, formats strfmt. func (o *GetFrontendOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getFrontendOK" + "." + "data") diff --git a/operations/global/get_global.go b/operations/global/get_global.go index 84682d10..7e7e8d69 100644 --- a/operations/global/get_global.go +++ b/operations/global/get_global.go @@ -153,6 +153,11 @@ func (o *GetGlobalOKBody) ContextValidate(ctx context.Context, formats strfmt.Re func (o *GetGlobalOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getGlobalOK" + "." + "data") diff --git a/operations/group/get_group.go b/operations/group/get_group.go index 23efc0b6..05627188 100644 --- a/operations/group/get_group.go +++ b/operations/group/get_group.go @@ -151,6 +151,11 @@ func (o *GetGroupOKBody) ContextValidate(ctx context.Context, formats strfmt.Reg func (o *GetGroupOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getGroupOK" + "." + "data") diff --git a/operations/http_after_response_rule/get_http_after_response_rule.go b/operations/http_after_response_rule/get_http_after_response_rule.go index 7f436208..57b5a011 100644 --- a/operations/http_after_response_rule/get_http_after_response_rule.go +++ b/operations/http_after_response_rule/get_http_after_response_rule.go @@ -153,6 +153,11 @@ func (o *GetHTTPAfterResponseRuleOKBody) ContextValidate(ctx context.Context, fo func (o *GetHTTPAfterResponseRuleOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getHttpAfterResponseRuleOK" + "." + "data") diff --git a/operations/http_check/get_http_check.go b/operations/http_check/get_http_check.go index 933c872f..4ed8c629 100644 --- a/operations/http_check/get_http_check.go +++ b/operations/http_check/get_http_check.go @@ -153,6 +153,11 @@ func (o *GetHTTPCheckOKBody) ContextValidate(ctx context.Context, formats strfmt func (o *GetHTTPCheckOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getHttpCheckOK" + "." + "data") diff --git a/operations/http_error_rule/get_http_error_rule.go b/operations/http_error_rule/get_http_error_rule.go index caf6e7a5..bde95702 100644 --- a/operations/http_error_rule/get_http_error_rule.go +++ b/operations/http_error_rule/get_http_error_rule.go @@ -153,6 +153,11 @@ func (o *GetHTTPErrorRuleOKBody) ContextValidate(ctx context.Context, formats st func (o *GetHTTPErrorRuleOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getHttpErrorRuleOK" + "." + "data") diff --git a/operations/http_errors/get_http_errors_section.go b/operations/http_errors/get_http_errors_section.go index 40b9e6de..86d6f707 100644 --- a/operations/http_errors/get_http_errors_section.go +++ b/operations/http_errors/get_http_errors_section.go @@ -153,6 +153,11 @@ func (o *GetHTTPErrorsSectionOKBody) ContextValidate(ctx context.Context, format func (o *GetHTTPErrorsSectionOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getHttpErrorsSectionOK" + "." + "data") diff --git a/operations/http_request_rule/get_http_request_rule.go b/operations/http_request_rule/get_http_request_rule.go index 4ad873d3..140c1df0 100644 --- a/operations/http_request_rule/get_http_request_rule.go +++ b/operations/http_request_rule/get_http_request_rule.go @@ -153,6 +153,11 @@ func (o *GetHTTPRequestRuleOKBody) ContextValidate(ctx context.Context, formats func (o *GetHTTPRequestRuleOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getHttpRequestRuleOK" + "." + "data") diff --git a/operations/http_response_rule/get_http_response_rule.go b/operations/http_response_rule/get_http_response_rule.go index 15ce1e89..bd5c34b9 100644 --- a/operations/http_response_rule/get_http_response_rule.go +++ b/operations/http_response_rule/get_http_response_rule.go @@ -153,6 +153,11 @@ func (o *GetHTTPResponseRuleOKBody) ContextValidate(ctx context.Context, formats func (o *GetHTTPResponseRuleOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getHttpResponseRuleOK" + "." + "data") diff --git a/operations/log_forward/get_log_forward.go b/operations/log_forward/get_log_forward.go index a4aa9f2b..76c3351c 100644 --- a/operations/log_forward/get_log_forward.go +++ b/operations/log_forward/get_log_forward.go @@ -153,6 +153,11 @@ func (o *GetLogForwardOKBody) ContextValidate(ctx context.Context, formats strfm func (o *GetLogForwardOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getLogForwardOK" + "." + "data") diff --git a/operations/log_target/get_log_target.go b/operations/log_target/get_log_target.go index 658bd57f..806d3311 100644 --- a/operations/log_target/get_log_target.go +++ b/operations/log_target/get_log_target.go @@ -153,6 +153,11 @@ func (o *GetLogTargetOKBody) ContextValidate(ctx context.Context, formats strfmt func (o *GetLogTargetOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getLogTargetOK" + "." + "data") diff --git a/operations/mailer_entry/get_mailer_entry.go b/operations/mailer_entry/get_mailer_entry.go index 1f8f5bb3..e86537e7 100644 --- a/operations/mailer_entry/get_mailer_entry.go +++ b/operations/mailer_entry/get_mailer_entry.go @@ -153,6 +153,11 @@ func (o *GetMailerEntryOKBody) ContextValidate(ctx context.Context, formats strf func (o *GetMailerEntryOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getMailerEntryOK" + "." + "data") diff --git a/operations/mailers/get_mailers_section.go b/operations/mailers/get_mailers_section.go index f09a62a1..3275ca55 100644 --- a/operations/mailers/get_mailers_section.go +++ b/operations/mailers/get_mailers_section.go @@ -153,6 +153,11 @@ func (o *GetMailersSectionOKBody) ContextValidate(ctx context.Context, formats s func (o *GetMailersSectionOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getMailersSectionOK" + "." + "data") diff --git a/operations/nameserver/get_nameserver.go b/operations/nameserver/get_nameserver.go index b9159796..6556aee8 100644 --- a/operations/nameserver/get_nameserver.go +++ b/operations/nameserver/get_nameserver.go @@ -153,6 +153,11 @@ func (o *GetNameserverOKBody) ContextValidate(ctx context.Context, formats strfm func (o *GetNameserverOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getNameserverOK" + "." + "data") diff --git a/operations/peer/get_peer_section.go b/operations/peer/get_peer_section.go index bd7f58e8..bd1b3d89 100644 --- a/operations/peer/get_peer_section.go +++ b/operations/peer/get_peer_section.go @@ -153,6 +153,11 @@ func (o *GetPeerSectionOKBody) ContextValidate(ctx context.Context, formats strf func (o *GetPeerSectionOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getPeerSectionOK" + "." + "data") diff --git a/operations/peer_entry/get_peer_entry.go b/operations/peer_entry/get_peer_entry.go index 81ee60db..34b6c34f 100644 --- a/operations/peer_entry/get_peer_entry.go +++ b/operations/peer_entry/get_peer_entry.go @@ -153,6 +153,11 @@ func (o *GetPeerEntryOKBody) ContextValidate(ctx context.Context, formats strfmt func (o *GetPeerEntryOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getPeerEntryOK" + "." + "data") diff --git a/operations/process_manager/get_program.go b/operations/process_manager/get_program.go index 3e75b1fc..67b6011e 100644 --- a/operations/process_manager/get_program.go +++ b/operations/process_manager/get_program.go @@ -153,6 +153,11 @@ func (o *GetProgramOKBody) ContextValidate(ctx context.Context, formats strfmt.R func (o *GetProgramOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getProgramOK" + "." + "data") diff --git a/operations/resolver/get_resolver.go b/operations/resolver/get_resolver.go index 60e9d32b..d47d20dd 100644 --- a/operations/resolver/get_resolver.go +++ b/operations/resolver/get_resolver.go @@ -153,6 +153,11 @@ func (o *GetResolverOKBody) ContextValidate(ctx context.Context, formats strfmt. func (o *GetResolverOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getResolverOK" + "." + "data") diff --git a/operations/ring/get_ring.go b/operations/ring/get_ring.go index 442e0c36..330b31cf 100644 --- a/operations/ring/get_ring.go +++ b/operations/ring/get_ring.go @@ -153,6 +153,11 @@ func (o *GetRingOKBody) ContextValidate(ctx context.Context, formats strfmt.Regi func (o *GetRingOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getRingOK" + "." + "data") diff --git a/operations/server/get_server.go b/operations/server/get_server.go index 168097a7..9e1cd23c 100644 --- a/operations/server/get_server.go +++ b/operations/server/get_server.go @@ -153,6 +153,11 @@ func (o *GetServerOKBody) ContextValidate(ctx context.Context, formats strfmt.Re func (o *GetServerOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getServerOK" + "." + "data") diff --git a/operations/server_switching_rule/get_server_switching_rule.go b/operations/server_switching_rule/get_server_switching_rule.go index 56467435..43a1b99d 100644 --- a/operations/server_switching_rule/get_server_switching_rule.go +++ b/operations/server_switching_rule/get_server_switching_rule.go @@ -153,6 +153,11 @@ func (o *GetServerSwitchingRuleOKBody) ContextValidate(ctx context.Context, form func (o *GetServerSwitchingRuleOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getServerSwitchingRuleOK" + "." + "data") diff --git a/operations/server_template/get_server_template.go b/operations/server_template/get_server_template.go index dbf3aae6..054ac575 100644 --- a/operations/server_template/get_server_template.go +++ b/operations/server_template/get_server_template.go @@ -153,6 +153,11 @@ func (o *GetServerTemplateOKBody) ContextValidate(ctx context.Context, formats s func (o *GetServerTemplateOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getServerTemplateOK" + "." + "data") diff --git a/operations/service_discovery/get_a_w_s_region.go b/operations/service_discovery/get_a_w_s_region.go index 11433bbd..04f46171 100644 --- a/operations/service_discovery/get_a_w_s_region.go +++ b/operations/service_discovery/get_a_w_s_region.go @@ -150,6 +150,11 @@ func (o *GetAWSRegionOKBody) ContextValidate(ctx context.Context, formats strfmt func (o *GetAWSRegionOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getAWSRegionOK" + "." + "data") diff --git a/operations/service_discovery/get_consul.go b/operations/service_discovery/get_consul.go index 2962c1ba..db6824a9 100644 --- a/operations/service_discovery/get_consul.go +++ b/operations/service_discovery/get_consul.go @@ -150,6 +150,11 @@ func (o *GetConsulOKBody) ContextValidate(ctx context.Context, formats strfmt.Re func (o *GetConsulOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getConsulOK" + "." + "data") diff --git a/operations/sites/get_site.go b/operations/sites/get_site.go index e7c7c728..8a28d567 100644 --- a/operations/sites/get_site.go +++ b/operations/sites/get_site.go @@ -153,6 +153,11 @@ func (o *GetSiteOKBody) ContextValidate(ctx context.Context, formats strfmt.Regi func (o *GetSiteOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getSiteOK" + "." + "data") diff --git a/operations/spoe/get_spoe_agent.go b/operations/spoe/get_spoe_agent.go index ae069450..37914d78 100644 --- a/operations/spoe/get_spoe_agent.go +++ b/operations/spoe/get_spoe_agent.go @@ -156,6 +156,7 @@ func (o *GetSpoeAgentOKBody) ContextValidate(ctx context.Context, formats strfmt func (o *GetSpoeAgentOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getSpoeAgentOK" + "." + "data") diff --git a/operations/spoe/get_spoe_group.go b/operations/spoe/get_spoe_group.go index 11adac0f..b2307055 100644 --- a/operations/spoe/get_spoe_group.go +++ b/operations/spoe/get_spoe_group.go @@ -156,6 +156,7 @@ func (o *GetSpoeGroupOKBody) ContextValidate(ctx context.Context, formats strfmt func (o *GetSpoeGroupOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getSpoeGroupOK" + "." + "data") diff --git a/operations/spoe/get_spoe_message.go b/operations/spoe/get_spoe_message.go index ef18f06e..e2031402 100644 --- a/operations/spoe/get_spoe_message.go +++ b/operations/spoe/get_spoe_message.go @@ -156,6 +156,7 @@ func (o *GetSpoeMessageOKBody) ContextValidate(ctx context.Context, formats strf func (o *GetSpoeMessageOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getSpoeMessageOK" + "." + "data") diff --git a/operations/spoe/get_spoe_scope.go b/operations/spoe/get_spoe_scope.go index 7ea81d98..d8d0a680 100644 --- a/operations/spoe/get_spoe_scope.go +++ b/operations/spoe/get_spoe_scope.go @@ -160,6 +160,7 @@ func (o *GetSpoeScopeOKBody) ContextValidate(ctx context.Context, formats strfmt func (o *GetSpoeScopeOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getSpoeScopeOK" + "." + "data") diff --git a/operations/stick_rule/get_stick_rule.go b/operations/stick_rule/get_stick_rule.go index 09f8bef3..38519ea2 100644 --- a/operations/stick_rule/get_stick_rule.go +++ b/operations/stick_rule/get_stick_rule.go @@ -153,6 +153,11 @@ func (o *GetStickRuleOKBody) ContextValidate(ctx context.Context, formats strfmt func (o *GetStickRuleOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getStickRuleOK" + "." + "data") diff --git a/operations/stick_table/set_stick_table_entries.go b/operations/stick_table/set_stick_table_entries.go index 5b3aa3f1..5d485abe 100644 --- a/operations/stick_table/set_stick_table_entries.go +++ b/operations/stick_table/set_stick_table_entries.go @@ -170,6 +170,7 @@ func (o *SetStickTableEntriesBody) ContextValidate(ctx context.Context, formats func (o *SetStickTableEntriesBody) contextValidateDataType(ctx context.Context, formats strfmt.Registry) error { if o.DataType != nil { + if err := o.DataType.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("stick_table_entry" + "." + "data_type") diff --git a/operations/table/get_table.go b/operations/table/get_table.go index 1f6f99a0..64ebfe56 100644 --- a/operations/table/get_table.go +++ b/operations/table/get_table.go @@ -153,6 +153,11 @@ func (o *GetTableOKBody) ContextValidate(ctx context.Context, formats strfmt.Reg func (o *GetTableOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getTableOK" + "." + "data") diff --git a/operations/tcp_check/get_tcp_check.go b/operations/tcp_check/get_tcp_check.go index 3311b23b..3db16ec7 100644 --- a/operations/tcp_check/get_tcp_check.go +++ b/operations/tcp_check/get_tcp_check.go @@ -153,6 +153,11 @@ func (o *GetTCPCheckOKBody) ContextValidate(ctx context.Context, formats strfmt. func (o *GetTCPCheckOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getTcpCheckOK" + "." + "data") diff --git a/operations/tcp_request_rule/get_tcp_request_rule.go b/operations/tcp_request_rule/get_tcp_request_rule.go index 32268553..ab950b55 100644 --- a/operations/tcp_request_rule/get_tcp_request_rule.go +++ b/operations/tcp_request_rule/get_tcp_request_rule.go @@ -153,6 +153,11 @@ func (o *GetTCPRequestRuleOKBody) ContextValidate(ctx context.Context, formats s func (o *GetTCPRequestRuleOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getTcpRequestRuleOK" + "." + "data") diff --git a/operations/tcp_response_rule/get_tcp_response_rule.go b/operations/tcp_response_rule/get_tcp_response_rule.go index 3f7eb8b4..b4ef153f 100644 --- a/operations/tcp_response_rule/get_tcp_response_rule.go +++ b/operations/tcp_response_rule/get_tcp_response_rule.go @@ -153,6 +153,11 @@ func (o *GetTCPResponseRuleOKBody) ContextValidate(ctx context.Context, formats func (o *GetTCPResponseRuleOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getTcpResponseRuleOK" + "." + "data") diff --git a/operations/user/get_user.go b/operations/user/get_user.go index 8f087968..f530c8ae 100644 --- a/operations/user/get_user.go +++ b/operations/user/get_user.go @@ -151,6 +151,11 @@ func (o *GetUserOKBody) ContextValidate(ctx context.Context, formats strfmt.Regi func (o *GetUserOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getUserOK" + "." + "data") diff --git a/operations/userlist/get_userlist.go b/operations/userlist/get_userlist.go index 63f34990..bc5144ad 100644 --- a/operations/userlist/get_userlist.go +++ b/operations/userlist/get_userlist.go @@ -153,6 +153,11 @@ func (o *GetUserlistOKBody) ContextValidate(ctx context.Context, formats strfmt. func (o *GetUserlistOKBody) contextValidateData(ctx context.Context, formats strfmt.Registry) error { if o.Data != nil { + + if swag.IsZero(o.Data) { // not required + return nil + } + if err := o.Data.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("getUserlistOK" + "." + "data") diff --git a/operations/specification_openapiv3/get_openapiv3_specification.go b/operations/version3/get_openapiv3_specification.go similarity index 98% rename from operations/specification_openapiv3/get_openapiv3_specification.go rename to operations/version3/get_openapiv3_specification.go index a230b44c..59793459 100644 --- a/operations/specification_openapiv3/get_openapiv3_specification.go +++ b/operations/version3/get_openapiv3_specification.go @@ -15,7 +15,7 @@ // limitations under the License. // -package specification_openapiv3 +package version3 // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command diff --git a/operations/specification_openapiv3/get_openapiv3_specification_parameters.go b/operations/version3/get_openapiv3_specification_parameters.go similarity index 98% rename from operations/specification_openapiv3/get_openapiv3_specification_parameters.go rename to operations/version3/get_openapiv3_specification_parameters.go index 233ae5a3..8910da91 100644 --- a/operations/specification_openapiv3/get_openapiv3_specification_parameters.go +++ b/operations/version3/get_openapiv3_specification_parameters.go @@ -15,7 +15,7 @@ // limitations under the License. // -package specification_openapiv3 +package version3 // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/operations/specification_openapiv3/get_openapiv3_specification_responses.go b/operations/version3/get_openapiv3_specification_responses.go similarity index 99% rename from operations/specification_openapiv3/get_openapiv3_specification_responses.go rename to operations/version3/get_openapiv3_specification_responses.go index eb4fb89a..d26db70d 100644 --- a/operations/specification_openapiv3/get_openapiv3_specification_responses.go +++ b/operations/version3/get_openapiv3_specification_responses.go @@ -15,7 +15,7 @@ // limitations under the License. // -package specification_openapiv3 +package version3 // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/operations/specification_openapiv3/get_openapiv3_specification_urlbuilder.go b/operations/version3/get_openapiv3_specification_urlbuilder.go similarity index 98% rename from operations/specification_openapiv3/get_openapiv3_specification_urlbuilder.go rename to operations/version3/get_openapiv3_specification_urlbuilder.go index d9bf5d39..2c69d733 100644 --- a/operations/specification_openapiv3/get_openapiv3_specification_urlbuilder.go +++ b/operations/version3/get_openapiv3_specification_urlbuilder.go @@ -15,7 +15,7 @@ // limitations under the License. // -package specification_openapiv3 +package version3 // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the generate command diff --git a/server.go b/server.go index 21d19c3b..011b035c 100644 --- a/server.go +++ b/server.go @@ -96,7 +96,7 @@ type Server struct { ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` - WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` + WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"30s"` httpServerL net.Listener TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"`