Skip to content

@nonull could have surprising effects in error cases #3733

@BoD

Description

@BoD

When a nullable field is marked @nonnull locally, it of course can still be returned as null by the backend. In particular this can happen in case of partial errors.

When that happens, a JsonDataException will be thrown at JSON reading time, in the Adapter's fromJson method.

If we consider that this will probably happen in typical uses, this may be considered surprising to users.

  • Maybe it's only a matter of adding a warning in the documentation.
  • Or we could investigate a way to throw something less "low level" and more descriptive

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions