codegenerator/model/model.go
func LoadAPIs(rootURL string) APIDefinitions {
	apiManifestURL := tcurls.APIManifest(rootURL)
	fmt.Printf("Downloading manifest from url: '%v'...\n", apiManifestURL)
	resp, err := http.Get(apiManifestURL)
	if err != nil {
		fmt.Printf("Could not download api manifest from url: '%v'!\n", apiManifestURL)
	}
	exitOnFail(err)
	apiManifestDecoder := json.NewDecoder(resp.Body)
	apiMan := TaskclusterServiceManifest{}
	err = apiManifestDecoder.Decode(&apiMan)
	exitOnFail(err)
	apiDefs := []*APIDefinition{}
	for i := range apiMan.References {
		var resp *http.Response
		resp, err = http.Get(apiMan.References[i])
		exitOnFail(err)
		defer resp.Body.Close()
		apiDef := &APIDefinition{
			URL: apiMan.References[i],
		}

		///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		// SKIP worker-manager for now, as we currently can't handle
		// https://github.com/taskcluster/taskcluster/blob/6282ebbcf0ddd00d5b3f7ac4b718247d615739f3/services/worker-manager/schemas/v1/worker-configuration.yml#L13-L15
		// despite it being valid jsonschema: https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.1.1
		if apiDef.URL == tcurls.APIReference(rootURL, "worker-manager", "v1") {
			continue
		}
		///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

		if apiDef.loadJSON(resp.Body, rootURL) {
			apiDefs = append(apiDefs, apiDef)
			// check that the json schema is valid!
			validateJSON(apiDef.SchemaURL, apiDef.URL)
		}
	}
	return APIDefinitions(apiDefs)
}
func LoadAPIs(rootURL string) APIDefinitions {
	apiManifestURL := tcurls.APIManifest(rootURL)
	fmt.Printf("Downloading manifest from url: '%v'...\n", apiManifestURL)
	resp, err := http.Get(apiManifestURL)
	if err != nil {
		fmt.Printf("Could not download api manifest from url: '%v'!\n", apiManifestURL)
	}
	exitOnFail(err)
	apiManifestDecoder := json.NewDecoder(resp.Body)
	apiMan := TaskclusterServiceManifest{}
	err = apiManifestDecoder.Decode(&apiMan)
	exitOnFail(err)
	apiDefs := []*APIDefinition{}
	for i := range apiMan.References {
		var resp *http.Response
		resp, err = http.Get(apiMan.References[i])
		exitOnFail(err)
		defer resp.Body.Close()
		apiDef := &APIDefinition{
			URL: apiMan.References[i],
		}

		///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		// SKIP worker-manager for now, as we currently can't handle
		// https://github.com/taskcluster/taskcluster/blob/6282ebbcf0ddd00d5b3f7ac4b718247d615739f3/services/worker-manager/schemas/v1/worker-configuration.yml#L13-L15
		// despite it being valid jsonschema: https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.1.1
		if apiDef.URL == tcurls.APIReference(rootURL, "worker-manager", "v1") {
			continue
		}
		///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

		if apiDef.loadJSON(resp.Body, rootURL) {
			apiDefs = append(apiDefs, apiDef)
			// check that the json schema is valid!
			validateJSON(apiDef.SchemaURL, apiDef.URL)
		}
	}
	return APIDefinitions(apiDefs)
}
// LoadAPIs takes care of reading all json files and performing elementary
// processing of the data, such as assigning unique type names to entities
// which will be translated to go types.
//
// Data is unmarshaled into objects (or instances of go types) and then
// postPopulate is called on the objects. This in turn triggers further reading
// of json files and unmarshalling where schemas refer to other schemas.
//
// When LoadAPIs returns, all json schemas and sub schemas should have been
// read and unmarhsalled into go objects.