Skip to content
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

Enable null reference types on next major version #1202

Open
baywet opened this issue Apr 4, 2023 · 3 comments · May be fixed by #2146
Open

Enable null reference types on next major version #1202

baywet opened this issue Apr 4, 2023 · 3 comments · May be fixed by #2146
Assignees
Labels
priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days type:enhancement Enhancement request targeting an existing experience V2-Enhancement
Milestone

Comments

@baywet
Copy link
Member

baywet commented Apr 4, 2023

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.

@baywet baywet added type:enhancement Enhancement request targeting an existing experience V2-Enhancement labels Apr 4, 2023
@baywet baywet added this to the NET:2.0 milestone Apr 4, 2023
@Eli-Black-Work
Copy link

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
Copy link
Contributor

HavenDV commented 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
Copy link
Contributor

HavenDV commented 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.

@darrelmiller darrelmiller added the priority:p0 Blocking issue/ loss of critical functions. An ICM may be filed to communicate urgency. SLA<=48hrs label Dec 19, 2024
@RachitMalik12 RachitMalik12 added priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days and removed priority:p0 Blocking issue/ loss of critical functions. An ICM may be filed to communicate urgency. SLA<=48hrs labels Jan 10, 2025
@MaggieKimani1 MaggieKimani1 linked a pull request Feb 14, 2025 that will close this issue
@baywet baywet assigned MaggieKimani1 and unassigned irvinesunday Feb 14, 2025
@baywet baywet modified the milestones: v2-preview9, v2-Preview10 Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days type:enhancement Enhancement request targeting an existing experience V2-Enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants