Skip to content

Enable null reference types on next major version #1202

Closed

Description

@baywet

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.

Activity

  1. added this to the NET:2.0 milestone on Apr 4, 2023
  2. Eli-Black-Work commented on May 10, 2023

    @Eli-Black-Work

    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.

  3. HavenDV commented on May 30, 2024

    @HavenDV
    Contributor

    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?

  4. HavenDV commented on Jun 26, 2024

    @HavenDV
    Contributor

    #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.

  5. added
    priority:p0Blocking issue/ loss of critical functions. An ICM may be filed to communicate urgency. SLA<=48hrs
    on Dec 19, 2024
  6. added
    priority:p1High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days
    and removed
    priority:p0Blocking issue/ loss of critical functions. An ICM may be filed to communicate urgency. SLA<=48hrs
    on Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

V2-EnhancementWIPpriority:p1High priority but not blocking. Causes major but not critical loss of functionality SLA <=7daystype:enhancementEnhancement request targeting an existing experience

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions