Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: "2"

formatters:
enable:
- gofmt
112 changes: 84 additions & 28 deletions internal/test/parameters/roundtrip/chi/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,87 @@ func writeJSON(w http.ResponseWriter, v interface{}) {
_ = json.NewEncoder(w).Encode(v)
}

func (s *Server) GetContentObject(w http.ResponseWriter, r *http.Request, param gen.ComplexObject) { writeJSON(w, param) }
func (s *Server) GetCookie(w http.ResponseWriter, r *http.Request, params gen.GetCookieParams) { writeJSON(w, params) }
func (s *Server) EnumParams(w http.ResponseWriter, r *http.Request, params gen.EnumParamsParams) { w.WriteHeader(http.StatusNoContent) }
func (s *Server) GetHeader(w http.ResponseWriter, r *http.Request, params gen.GetHeaderParams) { writeJSON(w, params) }
func (s *Server) GetLabelExplodeArray(w http.ResponseWriter, r *http.Request, param []int32) { writeJSON(w, param) }
func (s *Server) GetLabelExplodeObject(w http.ResponseWriter, r *http.Request, param gen.Object) { writeJSON(w, param) }
func (s *Server) GetLabelExplodePrimitive(w http.ResponseWriter, r *http.Request, param int32) { writeJSON(w, param) }
func (s *Server) GetLabelNoExplodeArray(w http.ResponseWriter, r *http.Request, param []int32) { writeJSON(w, param) }
func (s *Server) GetLabelNoExplodeObject(w http.ResponseWriter, r *http.Request, param gen.Object) { writeJSON(w, param) }
func (s *Server) GetLabelPrimitive(w http.ResponseWriter, r *http.Request, param int32) { writeJSON(w, param) }
func (s *Server) GetMatrixExplodeArray(w http.ResponseWriter, r *http.Request, id []int32) { writeJSON(w, id) }
func (s *Server) GetMatrixExplodeObject(w http.ResponseWriter, r *http.Request, id gen.Object) { writeJSON(w, id) }
func (s *Server) GetMatrixExplodePrimitive(w http.ResponseWriter, r *http.Request, id int32) { writeJSON(w, id) }
func (s *Server) GetMatrixNoExplodeArray(w http.ResponseWriter, r *http.Request, id []int32) { writeJSON(w, id) }
func (s *Server) GetMatrixNoExplodeObject(w http.ResponseWriter, r *http.Request, id gen.Object) { writeJSON(w, id) }
func (s *Server) GetMatrixPrimitive(w http.ResponseWriter, r *http.Request, id int32) { writeJSON(w, id) }
func (s *Server) GetPassThrough(w http.ResponseWriter, r *http.Request, param string) { writeJSON(w, param) }
func (s *Server) GetSimpleString(w http.ResponseWriter, r *http.Request, param string) { writeJSON(w, param) }
func (s *Server) GetDeepObject(w http.ResponseWriter, r *http.Request, params gen.GetDeepObjectParams) { writeJSON(w, params) }
func (s *Server) GetQueryDelimited(w http.ResponseWriter, r *http.Request, params gen.GetQueryDelimitedParams) { writeJSON(w, params) }
func (s *Server) GetQueryForm(w http.ResponseWriter, r *http.Request, params gen.GetQueryFormParams) { writeJSON(w, params) }
func (s *Server) GetSimpleExplodeArray(w http.ResponseWriter, r *http.Request, param []int32) { writeJSON(w, param) }
func (s *Server) GetSimpleExplodeObject(w http.ResponseWriter, r *http.Request, param gen.Object) { writeJSON(w, param) }
func (s *Server) GetSimpleExplodePrimitive(w http.ResponseWriter, r *http.Request, param int32) { writeJSON(w, param) }
func (s *Server) GetSimpleNoExplodeArray(w http.ResponseWriter, r *http.Request, param []int32) { writeJSON(w, param) }
func (s *Server) GetSimpleNoExplodeObject(w http.ResponseWriter, r *http.Request, param gen.Object) { writeJSON(w, param) }
func (s *Server) GetSimplePrimitive(w http.ResponseWriter, r *http.Request, param int32) { writeJSON(w, param) }
func (s *Server) GetStartingWithNumber(w http.ResponseWriter, r *http.Request, n1param string) { writeJSON(w, n1param) }
func (s *Server) GetContentObject(w http.ResponseWriter, r *http.Request, param gen.ComplexObject) {
writeJSON(w, param)
}
func (s *Server) GetCookie(w http.ResponseWriter, r *http.Request, params gen.GetCookieParams) {
writeJSON(w, params)
}
func (s *Server) EnumParams(w http.ResponseWriter, r *http.Request, params gen.EnumParamsParams) {
w.WriteHeader(http.StatusNoContent)
}
func (s *Server) GetHeader(w http.ResponseWriter, r *http.Request, params gen.GetHeaderParams) {
writeJSON(w, params)
}
func (s *Server) GetLabelExplodeArray(w http.ResponseWriter, r *http.Request, param []int32) {
writeJSON(w, param)
}
func (s *Server) GetLabelExplodeObject(w http.ResponseWriter, r *http.Request, param gen.Object) {
writeJSON(w, param)
}
func (s *Server) GetLabelExplodePrimitive(w http.ResponseWriter, r *http.Request, param int32) {
writeJSON(w, param)
}
func (s *Server) GetLabelNoExplodeArray(w http.ResponseWriter, r *http.Request, param []int32) {
writeJSON(w, param)
}
func (s *Server) GetLabelNoExplodeObject(w http.ResponseWriter, r *http.Request, param gen.Object) {
writeJSON(w, param)
}
func (s *Server) GetLabelPrimitive(w http.ResponseWriter, r *http.Request, param int32) {
writeJSON(w, param)
}
func (s *Server) GetMatrixExplodeArray(w http.ResponseWriter, r *http.Request, id []int32) {
writeJSON(w, id)
}
func (s *Server) GetMatrixExplodeObject(w http.ResponseWriter, r *http.Request, id gen.Object) {
writeJSON(w, id)
}
func (s *Server) GetMatrixExplodePrimitive(w http.ResponseWriter, r *http.Request, id int32) {
writeJSON(w, id)
}
func (s *Server) GetMatrixNoExplodeArray(w http.ResponseWriter, r *http.Request, id []int32) {
writeJSON(w, id)
}
func (s *Server) GetMatrixNoExplodeObject(w http.ResponseWriter, r *http.Request, id gen.Object) {
writeJSON(w, id)
}
func (s *Server) GetMatrixPrimitive(w http.ResponseWriter, r *http.Request, id int32) {
writeJSON(w, id)
}
func (s *Server) GetPassThrough(w http.ResponseWriter, r *http.Request, param string) {
writeJSON(w, param)
}
func (s *Server) GetSimpleString(w http.ResponseWriter, r *http.Request, param string) {
writeJSON(w, param)
}
func (s *Server) GetDeepObject(w http.ResponseWriter, r *http.Request, params gen.GetDeepObjectParams) {
writeJSON(w, params)
}
func (s *Server) GetQueryDelimited(w http.ResponseWriter, r *http.Request, params gen.GetQueryDelimitedParams) {
writeJSON(w, params)
}
func (s *Server) GetQueryForm(w http.ResponseWriter, r *http.Request, params gen.GetQueryFormParams) {
writeJSON(w, params)
}
func (s *Server) GetSimpleExplodeArray(w http.ResponseWriter, r *http.Request, param []int32) {
writeJSON(w, param)
}
func (s *Server) GetSimpleExplodeObject(w http.ResponseWriter, r *http.Request, param gen.Object) {
writeJSON(w, param)
}
func (s *Server) GetSimpleExplodePrimitive(w http.ResponseWriter, r *http.Request, param int32) {
writeJSON(w, param)
}
func (s *Server) GetSimpleNoExplodeArray(w http.ResponseWriter, r *http.Request, param []int32) {
writeJSON(w, param)
}
func (s *Server) GetSimpleNoExplodeObject(w http.ResponseWriter, r *http.Request, param gen.Object) {
writeJSON(w, param)
}
func (s *Server) GetSimplePrimitive(w http.ResponseWriter, r *http.Request, param int32) {
writeJSON(w, param)
}
func (s *Server) GetStartingWithNumber(w http.ResponseWriter, r *http.Request, n1param string) {
writeJSON(w, n1param)
}
112 changes: 84 additions & 28 deletions internal/test/parameters/roundtrip/echo/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,87 @@ type Server struct{}

var _ gen.ServerInterface = (*Server)(nil)

func (s *Server) GetContentObject(ctx echo.Context, param gen.ComplexObject) error { return ctx.JSON(http.StatusOK, param) }
func (s *Server) GetCookie(ctx echo.Context, params gen.GetCookieParams) error { return ctx.JSON(http.StatusOK, params) }
func (s *Server) EnumParams(ctx echo.Context, params gen.EnumParamsParams) error { return ctx.NoContent(http.StatusNoContent) }
func (s *Server) GetHeader(ctx echo.Context, params gen.GetHeaderParams) error { return ctx.JSON(http.StatusOK, params) }
func (s *Server) GetLabelExplodeArray(ctx echo.Context, param []int32) error { return ctx.JSON(http.StatusOK, param) }
func (s *Server) GetLabelExplodeObject(ctx echo.Context, param gen.Object) error { return ctx.JSON(http.StatusOK, param) }
func (s *Server) GetLabelExplodePrimitive(ctx echo.Context, param int32) error { return ctx.JSON(http.StatusOK, param) }
func (s *Server) GetLabelNoExplodeArray(ctx echo.Context, param []int32) error { return ctx.JSON(http.StatusOK, param) }
func (s *Server) GetLabelNoExplodeObject(ctx echo.Context, param gen.Object) error { return ctx.JSON(http.StatusOK, param) }
func (s *Server) GetLabelPrimitive(ctx echo.Context, param int32) error { return ctx.JSON(http.StatusOK, param) }
func (s *Server) GetMatrixExplodeArray(ctx echo.Context, id []int32) error { return ctx.JSON(http.StatusOK, id) }
func (s *Server) GetMatrixExplodeObject(ctx echo.Context, id gen.Object) error { return ctx.JSON(http.StatusOK, id) }
func (s *Server) GetMatrixExplodePrimitive(ctx echo.Context, id int32) error { return ctx.JSON(http.StatusOK, id) }
func (s *Server) GetMatrixNoExplodeArray(ctx echo.Context, id []int32) error { return ctx.JSON(http.StatusOK, id) }
func (s *Server) GetMatrixNoExplodeObject(ctx echo.Context, id gen.Object) error { return ctx.JSON(http.StatusOK, id) }
func (s *Server) GetMatrixPrimitive(ctx echo.Context, id int32) error { return ctx.JSON(http.StatusOK, id) }
func (s *Server) GetPassThrough(ctx echo.Context, param string) error { return ctx.JSON(http.StatusOK, param) }
func (s *Server) GetSimpleString(ctx echo.Context, param string) error { return ctx.JSON(http.StatusOK, param) }
func (s *Server) GetDeepObject(ctx echo.Context, params gen.GetDeepObjectParams) error { return ctx.JSON(http.StatusOK, params) }
func (s *Server) GetQueryDelimited(ctx echo.Context, params gen.GetQueryDelimitedParams) error { return ctx.JSON(http.StatusOK, params) }
func (s *Server) GetQueryForm(ctx echo.Context, params gen.GetQueryFormParams) error { return ctx.JSON(http.StatusOK, params) }
func (s *Server) GetSimpleExplodeArray(ctx echo.Context, param []int32) error { return ctx.JSON(http.StatusOK, param) }
func (s *Server) GetSimpleExplodeObject(ctx echo.Context, param gen.Object) error { return ctx.JSON(http.StatusOK, param) }
func (s *Server) GetSimpleExplodePrimitive(ctx echo.Context, param int32) error { return ctx.JSON(http.StatusOK, param) }
func (s *Server) GetSimpleNoExplodeArray(ctx echo.Context, param []int32) error { return ctx.JSON(http.StatusOK, param) }
func (s *Server) GetSimpleNoExplodeObject(ctx echo.Context, param gen.Object) error { return ctx.JSON(http.StatusOK, param) }
func (s *Server) GetSimplePrimitive(ctx echo.Context, param int32) error { return ctx.JSON(http.StatusOK, param) }
func (s *Server) GetStartingWithNumber(ctx echo.Context, n1param string) error { return ctx.JSON(http.StatusOK, n1param) }
func (s *Server) GetContentObject(ctx echo.Context, param gen.ComplexObject) error {
return ctx.JSON(http.StatusOK, param)
}
func (s *Server) GetCookie(ctx echo.Context, params gen.GetCookieParams) error {
return ctx.JSON(http.StatusOK, params)
}
func (s *Server) EnumParams(ctx echo.Context, params gen.EnumParamsParams) error {
return ctx.NoContent(http.StatusNoContent)
}
func (s *Server) GetHeader(ctx echo.Context, params gen.GetHeaderParams) error {
return ctx.JSON(http.StatusOK, params)
}
func (s *Server) GetLabelExplodeArray(ctx echo.Context, param []int32) error {
return ctx.JSON(http.StatusOK, param)
}
func (s *Server) GetLabelExplodeObject(ctx echo.Context, param gen.Object) error {
return ctx.JSON(http.StatusOK, param)
}
func (s *Server) GetLabelExplodePrimitive(ctx echo.Context, param int32) error {
return ctx.JSON(http.StatusOK, param)
}
func (s *Server) GetLabelNoExplodeArray(ctx echo.Context, param []int32) error {
return ctx.JSON(http.StatusOK, param)
}
func (s *Server) GetLabelNoExplodeObject(ctx echo.Context, param gen.Object) error {
return ctx.JSON(http.StatusOK, param)
}
func (s *Server) GetLabelPrimitive(ctx echo.Context, param int32) error {
return ctx.JSON(http.StatusOK, param)
}
func (s *Server) GetMatrixExplodeArray(ctx echo.Context, id []int32) error {
return ctx.JSON(http.StatusOK, id)
}
func (s *Server) GetMatrixExplodeObject(ctx echo.Context, id gen.Object) error {
return ctx.JSON(http.StatusOK, id)
}
func (s *Server) GetMatrixExplodePrimitive(ctx echo.Context, id int32) error {
return ctx.JSON(http.StatusOK, id)
}
func (s *Server) GetMatrixNoExplodeArray(ctx echo.Context, id []int32) error {
return ctx.JSON(http.StatusOK, id)
}
func (s *Server) GetMatrixNoExplodeObject(ctx echo.Context, id gen.Object) error {
return ctx.JSON(http.StatusOK, id)
}
func (s *Server) GetMatrixPrimitive(ctx echo.Context, id int32) error {
return ctx.JSON(http.StatusOK, id)
}
func (s *Server) GetPassThrough(ctx echo.Context, param string) error {
return ctx.JSON(http.StatusOK, param)
}
func (s *Server) GetSimpleString(ctx echo.Context, param string) error {
return ctx.JSON(http.StatusOK, param)
}
func (s *Server) GetDeepObject(ctx echo.Context, params gen.GetDeepObjectParams) error {
return ctx.JSON(http.StatusOK, params)
}
func (s *Server) GetQueryDelimited(ctx echo.Context, params gen.GetQueryDelimitedParams) error {
return ctx.JSON(http.StatusOK, params)
}
func (s *Server) GetQueryForm(ctx echo.Context, params gen.GetQueryFormParams) error {
return ctx.JSON(http.StatusOK, params)
}
func (s *Server) GetSimpleExplodeArray(ctx echo.Context, param []int32) error {
return ctx.JSON(http.StatusOK, param)
}
func (s *Server) GetSimpleExplodeObject(ctx echo.Context, param gen.Object) error {
return ctx.JSON(http.StatusOK, param)
}
func (s *Server) GetSimpleExplodePrimitive(ctx echo.Context, param int32) error {
return ctx.JSON(http.StatusOK, param)
}
func (s *Server) GetSimpleNoExplodeArray(ctx echo.Context, param []int32) error {
return ctx.JSON(http.StatusOK, param)
}
func (s *Server) GetSimpleNoExplodeObject(ctx echo.Context, param gen.Object) error {
return ctx.JSON(http.StatusOK, param)
}
func (s *Server) GetSimplePrimitive(ctx echo.Context, param int32) error {
return ctx.JSON(http.StatusOK, param)
}
func (s *Server) GetStartingWithNumber(ctx echo.Context, n1param string) error {
return ctx.JSON(http.StatusOK, n1param)
}
Loading
Loading