Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update template_funcs.go #567

Merged
merged 5 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/v0.36.2/no-external-links.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
changelog:
- type: FIX
issueLink: https://github.com/solo-io/solo-projects/issues/6768
resolvesIssue: false
description: >-
Update protobuf processing to no longer render links to locally hosted external API docs, as they are being removed.
7 changes: 6 additions & 1 deletion pkg/code-generator/docgen/funcs/template_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,13 @@ func linkForField(project *model.Project, docsOptions *options.DocsOptions) func
linkedFile = filepath.Base(file.GetName())
//return "", errors.Errorf("failed to get generated file path for proto %v in list %v", file.GetName(), project.Request.FileToGenerate)
}
linkedFile = relativeFilename(forFile.GetName(), linkedFile)

// Don't link to external apis docs, as they will be deleted
if strings.HasPrefix(linkedFile, "github.com/solo-io/gloo/projects/gloo/api/external") {
sheidkamp marked this conversation as resolved.
Show resolved Hide resolved
return typeName, nil
}

linkedFile = relativeFilename(forFile.GetName(), linkedFile)
if docsOptions.Output == options.Restructured {
linkText = ":ref:`message." + strings.TrimPrefix(field.GetTypeName(), ".") + "`"
} else {
Expand Down