Skip to content

Commit 92c5199

Browse files
ANcpLuaclaude
andcommitted
fix: remove dead GenerateDocumentationFile/NoWarn from .props, fix MA0026
GenerateDocumentationFile didn't help OpenAPI — the XmlCommentGenerator reads syntax trees directly, and XML docs don't transfer to generated wrapper delegates. Removed the setting and its NoWarn suppression. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4b07c08 commit 92c5199

2 files changed

Lines changed: 5 additions & 22 deletions

File tree

samples/ErrorOrX.Sample/TodoApi.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace ErrorOrX.Sample;
22

33
/// <summary>
4-
/// Todo API demonstrating ErrorOr endpoints with automatic error inference.
4+
/// Demonstrates ErrorOr endpoints with automatic error inference.
55
/// </summary>
66
/// <remarks>
77
/// <para>

src/ErrorOrX.Generators/build/ErrorOrX.Generators.props

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,10 @@
11
<Project>
22
<PropertyGroup>
3-
<!--
4-
IMPORTANT: ErrorOrGenerateJsonContext is disabled by default.
5-
6-
The generated ErrorOrJsonContext CANNOT be used for Native AOT because Roslyn
7-
source generators cannot see output from other generators. The System.Text.Json
8-
source generator will not process our generated JsonSerializerContext.
9-
10-
For AOT compatibility, you MUST create your own JsonSerializerContext:
11-
12-
[JsonSerializable(typeof(YourType))]
13-
internal partial class AppJsonSerializerContext : JsonSerializerContext { }
14-
15-
And register it:
16-
builder.Services.AddErrorOrEndpoints(o => o.UseJsonContext<AppJsonSerializerContext>());
17-
18-
See: https://learn.microsoft.com/aspnet/core/fundamentals/aot/request-delegate-generator/rdg
19-
-->
3+
<!-- Disabled by default: Roslyn generators cannot see other generators' output,
4+
so the STJ source generator won't process our generated JsonSerializerContext.
5+
For AOT, create your own JsonSerializerContext and register it via
6+
builder.Services.AddErrorOrEndpoints(o => o.UseJsonContext<YourContext>()); -->
207
<ErrorOrGenerateJsonContext Condition="'$(ErrorOrGenerateJsonContext)' == ''">false</ErrorOrGenerateJsonContext>
21-
<!-- Enable XML documentation for OpenAPI parameter descriptions -->
22-
<GenerateDocumentationFile Condition="'$(GenerateDocumentationFile)' == ''">true</GenerateDocumentationFile>
23-
<!-- Suppress XML doc warnings (CS1591: missing XML comment, CS1573: missing param tag) -->
24-
<NoWarn>$(NoWarn);CS1591;CS1573</NoWarn>
258
</PropertyGroup>
269

2710
<ItemGroup>

0 commit comments

Comments
 (0)