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

	// Sort resource names so iterations are always done in the same order
	rawResourceNames := make([]string, len(a.RawResources))
	idx := 0
	for name := range a.RawResources {
		rawResourceNames[idx] = name
		idx++
	}
	sort.Strings(rawResourceNames)

	// Analyze each resource
	for _, name := range rawResourceNames {
		err := a.AnalyzeResource(name, a.RawResources[name], &descriptor)
		if err != nil {
			return nil, err
		}
	}

	// We're done
	a.Registry.FinalizeTypeNames(&descriptor)
	return &descriptor, nil
}
func (a *APIAnalyzer) Analyze() (*gen.APIDescriptor, error) {
	descriptor := gen.APIDescriptor{
		Version:   a.Version,
		Resources: make(map[string]*gen.Resource),
		Types:     make(map[string]*gen.ObjectDataType),
	}
	a.descriptor = &descriptor

	// Sort resource names so iterations are always done in the same order
	rawResourceNames := make([]string, len(a.RawResources))
	idx := 0
	for name := range a.RawResources {
		rawResourceNames[idx] = name
		idx++
	}
	sort.Strings(rawResourceNames)

	// Analyze each resource
	for _, name := range rawResourceNames {
		err := a.AnalyzeResource(name, a.RawResources[name], &descriptor)
		if err != nil {
			return nil, err
		}
	}

	// We're done
	a.Registry.FinalizeTypeNames(&descriptor)
	return &descriptor, nil
}
// Analyze creates an API descriptor from raw resources and types.