dotnet-cqrs/Svrnty.CQRS.Grpc.Generators
Mathias Beaulieu-Duncan a05ebad7fc
All checks were successful
Publish NuGets / build (release) Successful in 28s
Fix CS8601 in generated proto→command list mappings
Generated CommandServiceImpl.g.cs had warnings like:
    Slug = request.Slug?.ToList(),   // CS8601 if Slug is non-nullable List<T>

The ?. was over-defensive: proto3 repeated fields are emitted as
RepeatedField<T> in C# and are NEVER null. The conditional access
made the result List<T>? which then triggered CS8601 when assigned
to a non-nullable target on the command POCO.

Dropped ?. in 4 emission sites in GrpcGenerator.cs covering:
- Top-level primitive list mapping (line 872)
- Top-level Guid list mapping (line 861)
- Nested primitive list mapping in NestedPropertyAssignment (line 1083)
- Complex list .Select chain in GenerateComplexListMapping (line 974,
  conditional: kept ?. for value-type collections where source.Items is
  read off a possibly-null wrapper message)

Real fix in the generator instead of CS8601 NoWarn suppression in
consumer csprojs. Consumers can drop the suppression after bumping.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 19:42:17 -04:00
..
build Refactor proto generation from source generator to MSBuild task 2026-01-26 14:35:56 -05:00
Helpers Apply dotnet format with new editorconfig rules 2026-03-12 03:30:50 -04:00
Models Apply dotnet format with new editorconfig rules 2026-03-12 03:30:50 -04:00
GenerateProtoFileTask.cs Refactor proto generation from source generator to MSBuild task 2026-01-26 14:35:56 -05:00
GrpcGenerator.cs Fix CS8601 in generated proto→command list mappings 2026-04-20 19:42:17 -04:00
ProtoFileGenerator.cs Handle generic types in proto message name generation 2026-02-19 18:56:37 -05:00
ProtoTypeMapper.cs Handle generic types in proto message name generation 2026-02-19 18:56:37 -05:00
Svrnty.CQRS.Grpc.Generators.csproj fix nuget package for Generator assembly? 2025-11-07 12:48:00 -05:00