I'm currently working on implementing an io-ts interface that resembles the following:
export interface myInterface {
[key:string]?: string | undefined | null
}
My objective is to convert this into its io-ts counterpart. Ultimately, I plan to merge it with an existing io-ts interface as shown below:
export const MyOtherInterfaceV = t.interface({
requiredProp1: ValidString// custom type, checks string is populated
requiredProp2: ValidString
// All other fields marked as required
})
export type MyOtherInterface = t.TypeOf<typeof MyOtherInterfaceV>;
The goal is to create a data structure that includes both mandatory validated fields and optional unknown fields. The intention is to fuse these structures for later processing, eventually storing the data in dynamodb.