code: func (a *AttributeDefinition) GenerateExample(rand *RandomGenerator, seen []string) interface{} {
  	if a.Example != nil {
  		return a.Example
  	}
  	if Design.NoExamples {
  		return nil
  	}
  
  	// Avoid infinite loops
  	var key string
  	if mt, ok := a.Type.(*MediaTypeDefinition); ok {
  		key = mt.Identifier
  	} else if ut, ok := a.Type.(*UserTypeDefinition); ok {
  		key = ut.TypeName
  	}
  	if key != "" {
  		count := 0
  		for _, k := range seen {
  			if k == key {
  				count++
  			}
  		}
  		if count > 1 {
  			// Only go a couple of levels deep
  			return nil
  		}
  		seen = append(seen, key)
  	}
  
  	switch {
  	case a.Type.IsArray():
  		a.Example = a.arrayExample(rand, seen)
  
  	case a.Type.IsHash():
  		a.Example = a.hashExample(rand, seen)
  
  	case a.Type.IsObject():
  		a.Example = a.objectExample(rand, seen)
  
  	default:
  		a.Example = newExampleGenerator(a, rand).Generate(seen)
  	}
  
  	return a.Example
  }
docs: // GenerateExample returns the value of the Example field if not nil. Otherwise it traverses the
  // attribute type and recursively generates an example. The result is saved in the Example field.