1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-02 07:44:51 +00:00

Add subContext data to validation

This commit is contained in:
Darren Shepherd
2018-02-26 16:09:04 -07:00
parent 5bce948e06
commit 2a6c821309

View File

@@ -12,6 +12,15 @@ func ParseAndValidateBody(apiContext *types.APIContext, create bool) (map[string
return nil, err return nil, err
} }
if create {
for key, value := range apiContext.SubContextAttributeProvider.Create(apiContext, apiContext.Schema) {
if data == nil {
data = map[string]interface{}{}
}
data[key] = value
}
}
b := builder.NewBuilder(apiContext) b := builder.NewBuilder(apiContext)
op := builder.Create op := builder.Create