Skip to content

NullableでないモデルにNullが入る可能性がある #4

@voltaney

Description

@voltaney

Problem

デシリアライズする際にSystem.Text.JsonがNullableでないメンバにNullを割り当てる可能性がある。
その際に、SuccessフラグがTrueになっているのはよろしくない。

Why

割り当てられるのは問題が、ResultにSuccessフラグが付くことが問題。
.Net9以降なら、NULL許容注釈オプションを追記することで例外の対応が可能。

参考:
https://learn.microsoft.com/ja-jp/dotnet/standard/serialization/system-text-json/nullable-annotations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions