You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enable null reference types on next major version #1202
null reference type support leverages the compiler to help us and consumers avoid null reference exceptions.
Effectively this would be a breaking change and what would be required would be to:
enable the feature in the csproj.
annotate all properties and method parameters/return types with ? when a null value makes sense.
check that we're not using null coalesce for strings, and instead string.IsNullOrEmpty in the code base
solve other issues reported by the compiler
EDIT: the work for v2 is happening on release/2.0.0, for anybody looking to contribute here, please target that branch.
Reacted by Peter Konradi, Eli-Black-Work, Jason Weinzierl, Glen, Jesper Kristensen, Konstantin S., Ralph Jansen, Ricardo Boss and hlovdal
Yes, please! 🙂 Our consuming project already leverages NRT's, and currently it's tricky to know which methods from the OpenAPI.NET NuGet might return null, since they're not annotated.
I see there's a bit of an issue with this, perhaps it's worth implementing this as a gradual rollout for individual files using #nullable enable instead of trying to do everything at once?
#1705
I've created a small PR to slowly move this issue towards a solution, I'm hoping for quick feedback/merge so I can continue this
For now this is just marking up the code as is with no behavior changes/test edits.
Activity
Eli-Black-Work commentedon May 10, 2023
Yes, please! 🙂 Our consuming project already leverages NRT's, and currently it's tricky to know which methods from the OpenAPI.NET NuGet might return
null, since they're not annotated.HavenDV commentedon May 30, 2024
I see there's a bit of an issue with this, perhaps it's worth implementing this as a gradual rollout for individual files using #nullable enable instead of trying to do everything at once?
HavenDV commentedon Jun 26, 2024
#1705
I've created a small PR to slowly move this issue towards a solution, I'm hoping for quick feedback/merge so I can continue this
For now this is just marking up the code as is with no behavior changes/test edits.