GitHub検索したらあるんだけど、Googleではあんまりヒットしないなぜ?
TypeScript力が低すぎて、いまいち何が書いてあるのかわからないのですが、とりあえずできたのでメモ。
import type { ValidatedEventAPIGatewayProxyEvent } from '@libs/api-gateway'; import { formatJSONResponse } from '@libs/api-gateway'; import { middyfy } from '@libs/lambda'; const hello: ValidatedEventAPIGatewayProxyEvent<void> = async () => { return formatJSONResponse({ message: `Hello. welcome to the porn Serverless world!` }); }; export const main = middyfy(hello);
テンプレ通りだと、schemaが必要なんだけど、 ValidatedEventAPIGatewayProxyEvent
の型?をvoidにすることでschemaを削除することができました。これだけ。