recurly-client-node icon indicating copy to clipboard operation
recurly-client-node copied to clipboard

Incorrect types in declaration file

Open charesbast opened this issue 4 years ago • 3 comments

Warning: Github issues are not an official support channel for Recurly. If you have an urgent request we suggest you contact us through an official channel: [email protected] or https://recurly.zendesk.com

Describe the bug

Types definitions are incorrect:

  • all fields are optional and nullable
  • some types are not strongly typed (ex: Plan.state -> string instead of an enum)

short example from the declaration file:

export declare class Plan {
  /**
   * Plan ID
   */
  id?: string | null; -> should be id: string;

That's a big problem because in that state those type definitions cannot be used... Are you aware of that issue ? And do you plan to fix it ?

Thanks !

charesbast avatar Dec 11 '20 15:12 charesbast

I want to chime in here that it's very inconvenient that every type is nullable (e.g. id on invoice - link). Could the developers please fix this to reflect what fields are actually nullable? This leads to code with either tons of redundant nullability checks, or null assertions.

wcauchois avatar May 17 '21 22:05 wcauchois

I want to chime in here that it's very inconvenient that every type is nullable (e.g. id on invoice - link). Could the developers please fix this to reflect what fields are actually nullable? This leads to code with either tons of redundant nullability checks, or null assertions.

Well I'm here a year later to complain about the same thing. It's a terrible developer experience.

Silverwolf90 avatar May 23 '22 11:05 Silverwolf90

I want to chime in here that it's very inconvenient that every type is nullable (e.g. id on invoice - link). Could the developers please fix this to reflect what fields are actually nullable? This leads to code with either tons of redundant nullability checks, or null assertions.

I'm also here to see if there is any plans to address this?

dmmulroy avatar Jun 11 '22 22:06 dmmulroy