How should JSON enum fields be validated in TypeScript API routes?