code: func parseEnum(ctx *context, enumNode *jsongo.JSONNode) (*Enum, error) {
  	if enumNode.Len() == 0 || enumNode.At(0).GetType() != jsongo.TypeValue {
  		return nil, errors.New("invalid JSON for enum specified")
  	}
  
  	enumName, ok := enumNode.At(0).Get().(string)
  	if !ok {
  		return nil, fmt.Errorf("enum name is %T, not a string", enumNode.At(0).Get())
  	}
  	enumType, ok := enumNode.At(enumNode.Len() - 1).At("enumtype").Get().(string)
  	if !ok {
  		return nil, fmt.Errorf("enum type invalid or missing")
  	}
  
  	enum := Enum{
  		Name: enumName,
  		Type: enumType,
  	}
  
  	// loop through enum entries, skip first (name) and last (enumtype)
  	for j := 1; j < enumNode.Len()-1; j++ {
  		if enumNode.At(j).GetType() == jsongo.TypeArray {
  			entry := enumNode.At(j)
  
  			if entry.Len() < 2 || entry.At(0).GetType() != jsongo.TypeValue || entry.At(1).GetType() != jsongo.TypeValue {
  				return nil, errors.New("invalid JSON for enum entry specified")
  			}
  
  			entryName, ok := entry.At(0).Get().(string)
  			if !ok {
  				return nil, fmt.Errorf("enum entry name is %T, not a string", entry.At(0).Get())
  			}
  			entryVal := entry.At(1).Get()
  
  			enum.Entries = append(enum.Entries, EnumEntry{
  				Name:  entryName,
  				Value: entryVal,
  			})
  		}
  	}
  
  	return &enum, nil
  }
docs: // parseEnum parses VPP binary API enum object from JSON node