Currently, I am in the process of validating API responses with io-ts.
In my TypeScript setup, I have already defined the following data structure:
export type Group = {
id: number;
name: string;
}
Now, my objective is to incorporate this type into io-ts as shown below:
const UploadedSearch = t.type({
id: t.number,
title: t.string,
groups: t.array(Group),
});
However, upon attempting to do so, I encountered the following error message.
TS2693: 'Group' only refers to a type, but is being used as a value here.
Would it be possible to utilize the Group
type within the io-ts syntax?