Skip to content

Commit

Permalink
importer-rest-api-specs: two loops become one
Browse files Browse the repository at this point in the history
  • Loading branch information
manicminer committed Jul 19, 2024
1 parent 4fcd170 commit 31b45ca
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,17 @@ func parseAPIVersion(serviceName string, input discoveryModels.AvailableDataSetF
logging.Tracef("Processing API Definitions from file %q - Completed.", filePath)
}

// Normalize names of all operations, resource IDs, constants, models, and field names, ensuring they are
// appropriately Pascal cased. We are doing this after building out all the resources, since some references
// can get updated out-of-band and would subsequently be missed if we normalized immediately after parsing
// each resource.
for resourceName, resource := range apiResources {
// Normalize names of all operations, resource IDs, constants, models, and field names, ensuring they are
// appropriately Pascal cased. We are doing this after building out all the resources, since some references
// can get updated out-of-band and would subsequently be missed if we normalized immediately after parsing
// each resource.
apiResources[resourceName] = cleanup.NormalizeAPIResource(resource)
}

// Now that we have a canonical list of resources - can we simplify the Operation names at all?
for resourceName, resource := range apiResources {
// Now that we have a canonical list of resources - can we simplify the Operation names at all?
logging.Tracef("Simplifying operation names for resource %q", resourceName)
updated := cleanup.SimplifyOperationNamesForAPIResource(resourceName, resource)
apiResources[resourceName] = updated
resource = cleanup.SimplifyOperationNamesForAPIResource(resourceName, resource)
apiResources[resourceName] = resource
}

apiVersion := sdkModels.APIVersion{
Expand Down

0 comments on commit 31b45ca

Please sign in to comment.