Skip to content

Commit

Permalink
precreate maps in schema
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Jan 16, 2018
1 parent 04bbf46 commit f7f989c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions types/reflection.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ func (s *Schemas) Import(version *APIVersion, obj interface{}, externalOverrides

func (s *Schemas) newSchemaFromType(version *APIVersion, t reflect.Type, typeName string) (*Schema, error) {
schema := &Schema{
ID: typeName,
Version: *version,
CodeName: t.Name(),
PkgName: t.PkgPath(),
ResourceFields: map[string]Field{},
ID: typeName,
Version: *version,
CodeName: t.Name(),
PkgName: t.PkgPath(),
ResourceFields: map[string]Field{},
ResourceActions: map[string]Action{},
CollectionActions: map[string]Action{},
}

if err := s.readFields(schema, t); err != nil {
Expand Down

0 comments on commit f7f989c

Please sign in to comment.