gen/api15gen/param_analyzer.go
func (p *ParamAnalyzer) newParam(path string, param map[string]interface{}, dType gen.DataType) *gen.ActionParam {
	var description, regexp string
	var mandatory, nonBlank bool
	var validValues []interface{}
	if d, ok := param["description"]; ok {
		description = d.(string)
	}
	if m, ok := param["mandatory"]; ok {
		mandatory = m.(bool)
	}
	if n, ok := param["non_blank"]; ok {
		nonBlank = n.(bool)
	}
	if r, ok := param["regexp"]; ok {
		regexp = r.(string)
	}
	if v, ok := param["valid_values"]; ok {
		validValues = v.([]interface{})
	}
	native := nativeNameFromPath(path)
	isLeaf := false
	if _, ok := dType.(*gen.EnumerableDataType); ok {
		isLeaf = true
	} else {
		for _, l := range p.leafParamNames {
			if path == l {
				isLeaf = true
				break
			}
		}
	}
	queryName := path
	if _, ok := dType.(*gen.ArrayDataType); ok {
		queryName += "[]"
	}
	actionParam := &gen.ActionParam{
		Name:        native,
		QueryName:   queryName,
		Description: removeBlankLines(description),
		VarName:     parseParamName(native),
		Type:        dType,
		Mandatory:   mandatory,
		NonBlank:    nonBlank,
		Regexp:      regexp,
		ValidValues: validValues,
	}
	if isLeaf {
		p.LeafParams = append(p.LeafParams, actionParam)
	}
	return actionParam
}
func (p *ParamAnalyzer) newParam(path string, param map[string]interface{}, dType gen.DataType) *gen.ActionParam {
	var description, regexp string
	var mandatory, nonBlank bool
	var validValues []interface{}
	if d, ok := param["description"]; ok {
		description = d.(string)
	}
	if m, ok := param["mandatory"]; ok {
		mandatory = m.(bool)
	}
	if n, ok := param["non_blank"]; ok {
		nonBlank = n.(bool)
	}
	if r, ok := param["regexp"]; ok {
		regexp = r.(string)
	}
	if v, ok := param["valid_values"]; ok {
		validValues = v.([]interface{})
	}
	native := nativeNameFromPath(path)
	isLeaf := false
	if _, ok := dType.(*gen.EnumerableDataType); ok {
		isLeaf = true
	} else {
		for _, l := range p.leafParamNames {
			if path == l {
				isLeaf = true
				break
			}
		}
	}
	queryName := path
	if _, ok := dType.(*gen.ArrayDataType); ok {
		queryName += "[]"
	}
	actionParam := &gen.ActionParam{
		Name:        native,
		QueryName:   queryName,
		Description: removeBlankLines(description),
		VarName:     parseParamName(native),
		Type:        dType,
		Mandatory:   mandatory,
		NonBlank:    nonBlank,
		Regexp:      regexp,
		ValidValues: validValues,
	}
	if isLeaf {
		p.LeafParams = append(p.LeafParams, actionParam)
	}
	return actionParam
}
// New parameter from raw values