add validator to service input parameter
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
e12c52b88f
commit
511070196b
|
@ -1,6 +1,10 @@
|
||||||
package config
|
package config
|
||||||
|
|
||||||
import "net/http"
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"git.xdrm.io/go/aicra/config/datatype"
|
||||||
|
)
|
||||||
|
|
||||||
var availableHTTPMethods = []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodDelete}
|
var availableHTTPMethods = []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodDelete}
|
||||||
|
|
||||||
|
@ -10,7 +14,9 @@ type Parameter struct {
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
Rename string `json:"name,omitempty"`
|
Rename string `json:"name,omitempty"`
|
||||||
Optional bool
|
Optional bool
|
||||||
// Default *interface{} `json:"default"`
|
|
||||||
|
// validator is set from the @Type
|
||||||
|
validator datatype.Validator
|
||||||
}
|
}
|
||||||
|
|
||||||
// Service represents a service definition (from api.json)
|
// Service represents a service definition (from api.json)
|
||||||
|
@ -22,7 +28,6 @@ type Service struct {
|
||||||
Download *bool `json:"download"`
|
Download *bool `json:"download"`
|
||||||
Input map[string]*Parameter `json:"in"`
|
Input map[string]*Parameter `json:"in"`
|
||||||
// Output map[string]*Parameter `json:"out"`
|
// Output map[string]*Parameter `json:"out"`
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Services contains every service that represents a server configuration
|
// Services contains every service that represents a server configuration
|
||||||
|
|
Loading…
Reference in New Issue