gen/goav2gen/api.go
func (a *APIAnalyzer) Analyze() (*gen.APIDescriptor, error) {
	api := gen.APIDescriptor{
		Version:   a.Version,
		Resources: make(map[string]*gen.Resource),
		Types:     make(map[string]*gen.ObjectDataType),
	}
	a.api = &api

	sortedVerbs := []string{"get", "post", "put", "delete"}
	paths := []string{}
	for path := range a.Doc.Paths {
		paths = append(paths, path)
	}
	sort.Strings(paths)
	for _, path := range paths {
		endpointMap := a.Doc.Paths[path]
		for _, verb := range sortedVerbs {
			if ep, ok := endpointMap[verb]; ok {
				a.AnalyzeEndpoint(verb, path, ep)
			}
		}
	}

	a.finalize()

	return &api, nil
}
func (a *APIAnalyzer) Analyze() (*gen.APIDescriptor, error) {
	api := gen.APIDescriptor{
		Version:   a.Version,
		Resources: make(map[string]*gen.Resource),
		Types:     make(map[string]*gen.ObjectDataType),
	}
	a.api = &api

	sortedVerbs := []string{"get", "post", "put", "delete"}
	paths := []string{}
	for path := range a.Doc.Paths {
		paths = append(paths, path)
	}
	sort.Strings(paths)
	for _, path := range paths {
		endpointMap := a.Doc.Paths[path]
		for _, verb := range sortedVerbs {
			if ep, ok := endpointMap[verb]; ok {
				a.AnalyzeEndpoint(verb, path, ep)
			}
		}
	}

	a.finalize()

	return &api, nil
}
// Analyze creates an API descriptor from raw resources and types.