1
0
mirror of https://github.com/rancher/types.git synced 2025-08-31 21:00:16 +00:00

Add creator to schemas

This commit is contained in:
Darren Shepherd
2017-12-28 09:52:40 -07:00
parent ee9dc3fbfa
commit 84e83e6ac9
2 changed files with 37 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ package factory
import (
"github.com/rancher/norman/types"
"github.com/rancher/norman/types/factory"
m "github.com/rancher/norman/types/mapper"
"github.com/rancher/types/mapper"
)
@@ -21,6 +22,9 @@ func Schemas(version *types.APIVersion) *types.Schemas {
})
return mappers
}
basePostFunc := schemas.DefaultPostMappers
schemas.DefaultPostMappers = func() []types.Mapper {
return append(basePostFunc(), &mapper.Creator{})
}
return schemas
}