Strapi 4 - How does Strapi define the property types of custom api's?

I was able to resolve this via the following two-step process. First I declared the object as unknown

        data:{
            identity: ctx.request.body.data.identity,
            model,
            subject,
            chatlog,
        }
} as unknown);

This allowed me to run yarn strapi ts:generate-types --debug. I also disabled a package that was causing other issues, this might also have been the reason why I couldn’t run this command before. So perhaps setting the object to unknown was not required. Either way, the problem is resolved.

Still don’t know exactly how the types are being declared, but strapi ts:generate-types seems to do the magic

1 Like