V5 Nullability seems... wrong?

Open
#1,204 11 comments 7 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
api

Research direction

Start by reviewing the V5 TypeScript type definitions and the Fern-generated API source mentioned in the issue, then compare response fields with the API documentation. Identify which fields are required or optional, including the invitation ID, organization ID, invitee, and inviter. Done means the generated definitions accurately represent the API's nullability.

Written by the indexing model from the issue text.

Description

Checklist
  • I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.
Describe the problem you'd like to have solved

With V5, it appears that every single field on responses is nullable. Up to and including the ID field on any given element. This can't possibly be correct, and because I know that some of these fields are non-null, I've in some places added asserts or ?? '' because I know they'll be there, but making everything optional means, simultaneously, that I have no idea what is actually optional. Here is one simple example -

export interface CreateOrganizationInvitationResponseContent {
    id?: string;
    organization_id?: string;
    inviter?: Management.OrganizationInvitationInviter;
    invitee?: Management.OrganizationInvitationInvitee;
    ...
}

An invitation will always minimally have an id, an org id, and an invitee - right? I think many of the rest of these are non-null too, but consider these as a starting point. Additionally, the Invitee and Inviter objects both have their properties as non-null, which feels odd?

Describe the ideal solution

Please update the type definitions to accurately reflect nullability. The type files say you're using Fern to generate them from an API - maybe one or both of those need to be updated to address this?

Dominant language
TypeScript
Stars
683
Forks
319
Avg merge
1d 30m
Merged PRs (30d)
13

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from auth0/node-auth0

All issues in auth0/node-auth0

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.