mirror of
https://github.com/rancher/norman.git
synced 2025-09-16 07:09:44 +00:00
Refactor types
This commit is contained in:
@@ -142,10 +142,14 @@ func (s *Schemas) importType(version *APIVersion, t reflect.Type, overrides ...r
|
||||
}
|
||||
|
||||
mappers := s.mapper(&schema.Version, schema.ID)
|
||||
if schema.CanList() {
|
||||
mappers = append(s.DefaultMappers, mappers...)
|
||||
if s.DefaultMappers != nil {
|
||||
if schema.CanList() {
|
||||
mappers = append(s.DefaultMappers(), mappers...)
|
||||
}
|
||||
}
|
||||
if s.DefaultPostMappers != nil {
|
||||
mappers = append(mappers, s.DefaultPostMappers()...)
|
||||
}
|
||||
mappers = append(mappers, s.DefaultPostMappers...)
|
||||
|
||||
if len(mappers) > 0 {
|
||||
copy, err := s.newSchemaFromType(version, t, typeName)
|
||||
|
Reference in New Issue
Block a user