TypeScript types error using zod.
Good Evening,
I have run a few different versions of the below fetch and parse of the json, I am recieving an error of "Unsafe return of an any[] type value" with both of these functions, I'm not sure what I am doing wrong. I also included my zod schemas to see if maybe thats where the problem is. I appreciate any and all help
1 Reply
I seem to have finally found something that works though idk how correct it is. I changed the ProfessorSchema to ProfSchema and then created another const ProfessorSchema which extends ProfSchema and then I left CourseSchema lazy loading where it is and it seems typescript is now able to infer the return value
would still love the opinion of someone more familiar with this than I
Bumping this