mirror of
https://github.com/rancher/norman.git
synced 2025-09-02 07:44:51 +00:00
Updates
This commit is contained in:
@@ -15,9 +15,12 @@ func ParseAndValidateBody(apiContext *types.APIContext) (map[string]interface{},
|
||||
b := builder.NewBuilder(apiContext)
|
||||
|
||||
data, err = b.Construct(apiContext.Schema, data, builder.Create)
|
||||
validator := apiContext.Schema.Validator
|
||||
if validator != nil {
|
||||
if err := validator(apiContext, data); err != nil {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if apiContext.Schema.Validator != nil {
|
||||
if err := apiContext.Schema.Validator(apiContext, data); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user