#A bug? with payload generated types vs the API response for a type

4 messages · Page 1 of 1 (latest)

hexed pivot
#

So payload generate:types produces:

export interface Usecase {
  id: string;
  slug: string;
  title: string;
  rank: number;
  shortDescription: string;
  longDescription: string;
  orgDescriptionOverride?: boolean | null;
  orgSpecificDescriptions?: OrgSpecificDescriptions;
  category?: (string | null) | Category;
  updatedAt: string;
  createdAt: string;
}
export interface OrgSpecificDescriptions {
  organizationId?: string | null;
  orgShortDescription: string;
  orgLongDescription: string;
}
unreal juniperBOT
hexed pivot
#

But an API response will produce:

       "orgSpecificDescriptions": {},
#

thus, if you try to directly use the generated types, it will complain that orgSpecificDescription is not "of type" OrgSpecificDescriptions