Skip to content

Commit aa6674a

Browse files
committed
docs: explain OAG003 configuration
1 parent 9454688 commit aa6674a

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,33 @@ internal sealed partial class SourceGenerationContext : JsonSerializerContext;
240240
```
241241
- It's all! Now you can build your project and use the generated code with full trimming/nativeAOT support.
242242

243+
### OAG003 converter composition diagnostic
244+
245+
When AutoSDK wraps a user-provided `JsonSerializerContext`, it reports
246+
informational diagnostic `OAG003`. The message names the wrapped context and
247+
the generated converters composed with it. This is an observability signal;
248+
suppressing it does not disable converter composition.
249+
250+
To suppress `OAG003` for an entire project, append it to `NoWarn`:
251+
252+
```xml
253+
<PropertyGroup>
254+
<NoWarn>$(NoWarn);OAG003</NoWarn>
255+
</PropertyGroup>
256+
```
257+
258+
For repository-wide or path-specific control, configure the diagnostic in
259+
`.editorconfig`:
260+
261+
```ini
262+
[*.cs]
263+
# Valid values include none, suggestion, warning, and error.
264+
dotnet_diagnostic.OAG003.severity = none
265+
```
266+
267+
Use `suggestion` to keep the informational IDE signal, or promote it to
268+
`warning`/`error` when converter composition must be audited in CI.
269+
243270
## Known Errors
244271

245272
### Generator error: "Could not write to output file 'Path/to/file'. Could not find part of the path"

examples/SourceGeneratorNativeAot/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ converters emitted by AutoSDK. Consumers do not need to duplicate the generated
1616
converter list in `JsonSourceGenerationOptions`.
1717

1818
The source generator reports informational diagnostic `OAG003` with the
19-
generated converters composed into each wrapper context.
19+
generated converters composed into each wrapper context. See the
20+
[root diagnostic guidance](../../README.md#oag003-converter-composition-diagnostic)
21+
for project-level suppression and `.editorconfig` severity configuration.
2022

2123
The models and client projects enable trimming and NativeAOT analyzers. All projects are
2224
included in `AutoSDK.slnx`, so the repository build continuously verifies this

0 commit comments

Comments
 (0)