diff --git a/src/api-collector/main.go b/src/api-collector/main.go index 23cf979c..354b89b1 100644 --- a/src/api-collector/main.go +++ b/src/api-collector/main.go @@ -37,11 +37,6 @@ import ( const API_DOCS_REPO = "api-hub" -type assetInfo struct { - id int64 - name string -} - type OpenAPIInfo struct { Version string `yaml:"version"` Title string `yaml:"title"` @@ -155,27 +150,6 @@ func getAPISpecsUrls(ctx context.Context, client *github.Client, owner string, r return m.OpenApiSpecs, nil } -func getAPISpecAssets(ctx context.Context, client *github.Client, owner string, repo string) []assetInfo { - var apiSpecs []assetInfo - release, _, err := client.Repositories.GetLatestRelease(ctx, owner, repo) - if err != nil { - log.Println("\t- No release found") - return apiSpecs - } - log.Printf("\t+ Latest release found: %s\n", *release.Name) - assets, _, err := client.Repositories.ListReleaseAssets(ctx, owner, repo, *release.ID, nil) - if err != nil { - log.Println("\t- No assets found in the release") - return apiSpecs - } - for _, asset := range assets { - if strings.Contains(*asset.Name, "_openapi.yaml") || strings.Contains(*asset.Name, "_openapi.yml") { - apiSpecs = append(apiSpecs, assetInfo{*asset.ID, *asset.Name}) - } - } - return apiSpecs -} - func downloadAPISpecs(repo string, specsUrls []string) []string { var downloadedSpecs []string for _, url := range specsUrls {