you can do validation/"contracts" at API boundaries using spec or malli. Theyre more feature-rich than types

(I havent had to personally use them though)