mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
[go-server] move errMsg helpers to helpers file (#20876)
This commit is contained in:
parent
1c1365513f
commit
b1f572e116
@ -15,6 +15,10 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const errMsgRequiredMissing = "required parameter is missing"
|
||||
const errMsgMinValueConstraint = "provided parameter is not respecting minimum value constraint"
|
||||
const errMsgMaxValueConstraint = "provided parameter is not respecting maximum value constraint"
|
||||
|
||||
// Response return a ImplResponse struct filled
|
||||
func Response(code int, body interface{}) ImplResponse {
|
||||
return ImplResponse {
|
||||
|
@ -34,10 +34,6 @@ type Router interface {
|
||||
Routes() Routes
|
||||
}
|
||||
|
||||
const errMsgRequiredMissing = "required parameter is missing"
|
||||
const errMsgMinValueConstraint = "provided parameter is not respecting minimum value constraint"
|
||||
const errMsgMaxValueConstraint = "provided parameter is not respecting maximum value constraint"
|
||||
|
||||
// NewRouter creates a new router for any number of api routers
|
||||
func NewRouter(routers ...Router) {{#routers}}{{#mux}}*mux.Router{{/mux}}{{#chi}}chi.Router{{/chi}}{{/routers}} {
|
||||
{{#routers}}
|
||||
|
@ -24,6 +24,10 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const errMsgRequiredMissing = "required parameter is missing"
|
||||
const errMsgMinValueConstraint = "provided parameter is not respecting minimum value constraint"
|
||||
const errMsgMaxValueConstraint = "provided parameter is not respecting maximum value constraint"
|
||||
|
||||
// Response return a ImplResponse struct filled
|
||||
func Response(code int, body interface{}) ImplResponse {
|
||||
return ImplResponse {
|
||||
|
@ -30,10 +30,6 @@ type Router interface {
|
||||
Routes() Routes
|
||||
}
|
||||
|
||||
const errMsgRequiredMissing = "required parameter is missing"
|
||||
const errMsgMinValueConstraint = "provided parameter is not respecting minimum value constraint"
|
||||
const errMsgMaxValueConstraint = "provided parameter is not respecting maximum value constraint"
|
||||
|
||||
// NewRouter creates a new router for any number of api routers
|
||||
func NewRouter(routers ...Router) chi.Router {
|
||||
router := chi.NewRouter()
|
||||
|
@ -24,6 +24,10 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const errMsgRequiredMissing = "required parameter is missing"
|
||||
const errMsgMinValueConstraint = "provided parameter is not respecting minimum value constraint"
|
||||
const errMsgMaxValueConstraint = "provided parameter is not respecting maximum value constraint"
|
||||
|
||||
// Response return a ImplResponse struct filled
|
||||
func Response(code int, body interface{}) ImplResponse {
|
||||
return ImplResponse {
|
||||
|
@ -30,10 +30,6 @@ type Router interface {
|
||||
Routes() Routes
|
||||
}
|
||||
|
||||
const errMsgRequiredMissing = "required parameter is missing"
|
||||
const errMsgMinValueConstraint = "provided parameter is not respecting minimum value constraint"
|
||||
const errMsgMaxValueConstraint = "provided parameter is not respecting maximum value constraint"
|
||||
|
||||
// NewRouter creates a new router for any number of api routers
|
||||
func NewRouter(routers ...Router) *mux.Router {
|
||||
router := mux.NewRouter().StrictSlash(true)
|
||||
|
@ -24,6 +24,10 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const errMsgRequiredMissing = "required parameter is missing"
|
||||
const errMsgMinValueConstraint = "provided parameter is not respecting minimum value constraint"
|
||||
const errMsgMaxValueConstraint = "provided parameter is not respecting maximum value constraint"
|
||||
|
||||
// Response return a ImplResponse struct filled
|
||||
func Response(code int, body interface{}) ImplResponse {
|
||||
return ImplResponse {
|
||||
|
@ -30,10 +30,6 @@ type Router interface {
|
||||
Routes() Routes
|
||||
}
|
||||
|
||||
const errMsgRequiredMissing = "required parameter is missing"
|
||||
const errMsgMinValueConstraint = "provided parameter is not respecting minimum value constraint"
|
||||
const errMsgMaxValueConstraint = "provided parameter is not respecting maximum value constraint"
|
||||
|
||||
// NewRouter creates a new router for any number of api routers
|
||||
func NewRouter(routers ...Router) *mux.Router {
|
||||
router := mux.NewRouter().StrictSlash(true)
|
||||
|
@ -24,6 +24,10 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const errMsgRequiredMissing = "required parameter is missing"
|
||||
const errMsgMinValueConstraint = "provided parameter is not respecting minimum value constraint"
|
||||
const errMsgMaxValueConstraint = "provided parameter is not respecting maximum value constraint"
|
||||
|
||||
// Response return a ImplResponse struct filled
|
||||
func Response(code int, body interface{}) ImplResponse {
|
||||
return ImplResponse {
|
||||
|
@ -30,10 +30,6 @@ type Router interface {
|
||||
Routes() Routes
|
||||
}
|
||||
|
||||
const errMsgRequiredMissing = "required parameter is missing"
|
||||
const errMsgMinValueConstraint = "provided parameter is not respecting minimum value constraint"
|
||||
const errMsgMaxValueConstraint = "provided parameter is not respecting maximum value constraint"
|
||||
|
||||
// NewRouter creates a new router for any number of api routers
|
||||
func NewRouter(routers ...Router) chi.Router {
|
||||
router := chi.NewRouter()
|
||||
|
Loading…
x
Reference in New Issue
Block a user