(ctx context.Context, client *github.Client, gitRef string)
| 35 | } |
| 36 | |
| 37 | func getOpsFromGithub(ctx context.Context, client *github.Client, gitRef string) ([]*operation, error) { |
| 38 | descs, err := getDescriptions(ctx, client, gitRef) |
| 39 | if err != nil { |
| 40 | return nil, err |
| 41 | } |
| 42 | var ops []*operation |
| 43 | for _, desc := range descs { |
| 44 | for p, pathItem := range desc.description.Paths.Map() { |
| 45 | for method, op := range pathItem.Operations() { |
| 46 | docURL := "" |
| 47 | if op.ExternalDocs != nil { |
| 48 | docURL = op.ExternalDocs.URL |
| 49 | } |
| 50 | ops = addOperation(ops, desc.filename, method+" "+p, docURL) |
| 51 | } |
| 52 | } |
| 53 | } |
| 54 | sortOperations(ops) |
| 55 | return ops, nil |
| 56 | } |
| 57 | |
| 58 | func (o *openapiFile) loadDescription(ctx context.Context, client *github.Client, gitRef string) error { |
| 59 | contents, resp, err := client.Repositories.DownloadContents( |
no test coverage detected
searching dependent graphs…