Skip to content
Snippets Groups Projects
Unverified Commit 78d257d3 authored by Bob Callaway's avatar Bob Callaway Committed by GitHub
Browse files

backoff go-swagger to last release (#118)

parent 34dff4c1
No related branches found
No related tags found
No related merge requests found
Showing
with 17 additions and 17 deletions
......@@ -23,14 +23,12 @@ package entries
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"io"
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/validate"
"github.com/projectrekor/rekor/pkg/generated/models"
)
......@@ -81,11 +79,6 @@ func (o *CreateLogEntryParams) BindRequest(r *http.Request, route *middleware.Ma
res = append(res, err)
}
ctx := validate.WithOperationRequest(context.Background())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.ProposedEntry = body
}
......
......@@ -62,12 +62,14 @@ func (o *GetLogEntryByIndex) ServeHTTP(rw http.ResponseWriter, r *http.Request)
r = rCtx
}
var Params = NewGetLogEntryByIndexParams()
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}
......@@ -111,7 +111,7 @@ func (o *GetLogEntryByIndexParams) bindLogIndex(rawData []string, hasKey bool, f
// validateLogIndex carries on validations for parameter LogIndex
func (o *GetLogEntryByIndexParams) validateLogIndex(formats strfmt.Registry) error {
if err := validate.MinimumInt("logIndex", "query", o.LogIndex, 0, false); err != nil {
if err := validate.MinimumInt("logIndex", "query", int64(o.LogIndex), 0, false); err != nil {
return err
}
......
......@@ -62,12 +62,14 @@ func (o *GetLogEntryByUUID) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
r = rCtx
}
var Params = NewGetLogEntryByUUIDParams()
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}
......@@ -64,12 +64,14 @@ func (o *GetLogEntryProof) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
r = rCtx
}
var Params = NewGetLogEntryProofParams()
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}
......@@ -62,12 +62,14 @@ func (o *SearchLogQuery) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
r = rCtx
}
var Params = NewSearchLogQueryParams()
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}
......@@ -23,14 +23,12 @@ package entries
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"io"
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/validate"
"github.com/projectrekor/rekor/pkg/generated/models"
)
......@@ -82,11 +80,6 @@ func (o *SearchLogQueryParams) BindRequest(r *http.Request, route *middleware.Ma
res = append(res, err)
}
ctx := validate.WithOperationRequest(context.Background())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Entry = &body
}
......
......@@ -64,12 +64,14 @@ func (o *GetLogInfo) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
r = rCtx
}
var Params = NewGetLogInfoParams()
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}
......@@ -64,12 +64,14 @@ func (o *GetLogProof) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
r = rCtx
}
var Params = NewGetLogProofParams()
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}
......@@ -129,7 +129,7 @@ func (o *GetLogProofParams) bindFirstSize(rawData []string, hasKey bool, formats
// validateFirstSize carries on validations for parameter FirstSize
func (o *GetLogProofParams) validateFirstSize(formats strfmt.Registry) error {
if err := validate.MinimumInt("firstSize", "query", *o.FirstSize, 1, false); err != nil {
if err := validate.MinimumInt("firstSize", "query", int64(*o.FirstSize), 1, false); err != nil {
return err
}
......@@ -168,7 +168,7 @@ func (o *GetLogProofParams) bindLastSize(rawData []string, hasKey bool, formats
// validateLastSize carries on validations for parameter LastSize
func (o *GetLogProofParams) validateLastSize(formats strfmt.Registry) error {
if err := validate.MinimumInt("lastSize", "query", o.LastSize, 1, false); err != nil {
if err := validate.MinimumInt("lastSize", "query", int64(o.LastSize), 1, false); err != nil {
return err
}
......
......@@ -64,12 +64,14 @@ func (o *GetPublicKey) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
r = rCtx
}
var Params = NewGetPublicKeyParams()
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment