Change swagger docs to refer to main (#6337)

This commit is contained in:
Oscar Hinton 2025-09-15 15:02:40 +02:00 committed by GitHub
parent 6ade09312f
commit b4a0555a72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,8 +17,6 @@ namespace Bit.SharedWeb.Swagger;
/// </summary>
public class SourceFileLineOperationFilter : IOperationFilter
{
private static readonly string _gitCommit = GitCommitDocumentFilter.GitCommit ?? "main";
public void Apply(OpenApiOperation operation, OperationFilterContext context)
{
@ -27,7 +25,7 @@ public class SourceFileLineOperationFilter : IOperationFilter
{
// Add the information with a link to the source file at the end of the operation description
operation.Description +=
$"\nThis operation is defined on: [`https://github.com/bitwarden/server/blob/{_gitCommit}/{fileName}#L{lineNumber}`]";
$"\nThis operation is defined on: [`https://github.com/bitwarden/server/blob/main/{fileName}#L{lineNumber}`]";
// Also add the information as extensions, so other tools can use it in the future
operation.Extensions.Add("x-source-file", new OpenApiString(fileName));