gen/praxisgen/action_analysis.go
func (a *APIAnalyzer) ParseUrls(urls interface{}) ([]*gen.PathPattern, error) {
	var patterns []*gen.PathPattern
	if urlElems, ok := urls.([]interface{}); ok {
		patterns = make([]*gen.PathPattern, len(urlElems))
		for i, elem := range urlElems {
			if pair, ok := elem.([]interface{}); ok {
				if len(pair) != 2 {
					return nil, fmt.Errorf("Invalid URL pair %v, must be [verb, path]", pair)
				}
				patterns[i] = toPattern(pair[0].(string), pair[1].(string))
			} else if url, ok := elem.(map[string]interface{}); ok {
				verb, ok := url["verb"].(string)
				if !ok {
					return nil, fmt.Errorf("Missing verb in url %v", url)
				}
				path, ok := url["path"].(string)
				if !ok {
					return nil, fmt.Errorf("Missing path in url %v", url)
				}
				patterns[i] = toPattern(verb, path)
			} else {
				return nil, fmt.Errorf("Invalid url format %#v", elem)
			}
		}
	} else {
		return nil, fmt.Errorf("Invalid \"urls\" format %v", prettify(urls))
	}
	return patterns, nil
}
func (a *APIAnalyzer) ParseUrls(urls interface{}) ([]*gen.PathPattern, error) {
	var patterns []*gen.PathPattern
	if urlElems, ok := urls.([]interface{}); ok {
		patterns = make([]*gen.PathPattern, len(urlElems))
		for i, elem := range urlElems {
			if pair, ok := elem.([]interface{}); ok {
				if len(pair) != 2 {
					return nil, fmt.Errorf("Invalid URL pair %v, must be [verb, path]", pair)
				}
				patterns[i] = toPattern(pair[0].(string), pair[1].(string))
			} else if url, ok := elem.(map[string]interface{}); ok {
				verb, ok := url["verb"].(string)
				if !ok {
					return nil, fmt.Errorf("Missing verb in url %v", url)
				}
				path, ok := url["path"].(string)
				if !ok {
					return nil, fmt.Errorf("Missing path in url %v", url)
				}
				patterns[i] = toPattern(verb, path)
			} else {
				return nil, fmt.Errorf("Invalid url format %#v", elem)
			}
		}
	} else {
		return nil, fmt.Errorf("Invalid \"urls\" format %v", prettify(urls))
	}
	return patterns, nil
}
// ParseUrls extracts the path patterns from an action URLs.
// Urls consist of an array of map, each map has the following keys:
// "verb", "path", "version"
// Also make it support the resticle format: array of pairs of verb + path.