Skip to content

fix(OpenAPI): add GeneratedCodeAttribute to generated classes #62710

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

Merged
merged 2 commits into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions src/OpenApi/gen/XmlCommentGenerator.Emitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ private static Dictionary<string, XmlComment> GenerateCacheEntries()
}
}

{{GeneratedCodeAttribute}}
file static class DocumentationCommentIdHelper
{
/// <summary>
Expand Down Expand Up @@ -444,6 +445,7 @@ public Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext
}
}

{{GeneratedCodeAttribute}}
file static class JsonNodeExtensions
{
public static JsonNode? Parse(this string? json)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ private static Dictionary<string, XmlComment> GenerateCacheEntries()
}
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class DocumentationCommentIdHelper
{
/// <summary>
Expand Down Expand Up @@ -426,6 +427,7 @@ public Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext
}
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class JsonNodeExtensions
{
public static JsonNode? Parse(this string? json)
Expand Down Expand Up @@ -500,4 +502,4 @@ public static IServiceCollection AddOpenApi(this IServiceCollection services, st
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ private static Dictionary<string, XmlComment> GenerateCacheEntries()
}
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class DocumentationCommentIdHelper
{
/// <summary>
Expand Down Expand Up @@ -455,6 +456,7 @@ public Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext
}
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class JsonNodeExtensions
{
public static JsonNode? Parse(this string? json)
Expand Down Expand Up @@ -497,4 +499,4 @@ public static IServiceCollection AddOpenApi(this IServiceCollection services)
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ method as a cref attribute.
}
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class DocumentationCommentIdHelper
{
/// <summary>
Expand Down Expand Up @@ -547,6 +548,7 @@ public Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext
}
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class JsonNodeExtensions
{
public static JsonNode? Parse(this string? json)
Expand Down Expand Up @@ -589,4 +591,4 @@ public static IServiceCollection AddOpenApi(this IServiceCollection services)
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ private static Dictionary<string, XmlComment> GenerateCacheEntries()
}
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class DocumentationCommentIdHelper
{
/// <summary>
Expand Down Expand Up @@ -430,6 +431,7 @@ public Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext
}
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class JsonNodeExtensions
{
public static JsonNode? Parse(this string? json)
Expand Down Expand Up @@ -472,4 +474,4 @@ public static IServiceCollection AddOpenApi(this IServiceCollection services)
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ private static Dictionary<string, XmlComment> GenerateCacheEntries()
}
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class DocumentationCommentIdHelper
{
/// <summary>
Expand Down Expand Up @@ -448,6 +449,7 @@ public Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext
}
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class JsonNodeExtensions
{
public static JsonNode? Parse(this string? json)
Expand Down Expand Up @@ -490,4 +492,4 @@ public static IServiceCollection AddOpenApi(this IServiceCollection services)
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ private static Dictionary<string, XmlComment> GenerateCacheEntries()
}
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class DocumentationCommentIdHelper
{
/// <summary>
Expand Down Expand Up @@ -456,6 +457,7 @@ public Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext
}
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.AspNetCore.OpenApi.SourceGenerators, Version=42.42.42.42, Culture=neutral, PublicKeyToken=adb9793829ddae60", "42.42.42.42")]
file static class JsonNodeExtensions
{
public static JsonNode? Parse(this string? json)
Expand Down Expand Up @@ -498,4 +500,4 @@ public static IServiceCollection AddOpenApi(this IServiceCollection services)
}

}
}
}
Loading