mirror of
https://github.com/rancher/norman.git
synced 2025-09-01 07:08:59 +00:00
Add InputFormatter that runs before the builder/validation
This commit is contained in:
@@ -27,6 +27,12 @@ func ParseAndValidateBody(apiContext *types.APIContext, create bool) (map[string
|
||||
if !create {
|
||||
op = builder.Update
|
||||
}
|
||||
if apiContext.Schema.InputFormatter != nil {
|
||||
err = apiContext.Schema.InputFormatter(apiContext, apiContext.Schema, data, create)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
data, err = b.Construct(apiContext.Schema, data, op)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user