Comment

Comment by sk0g

Just curious, is there a way to define typed DTOs or things like Pydantic models, and then parse blobs of JSON into said classes, all leveraging the type annotations?

I know it all gets compiled away in JS and all, but Pydantic is surprisingly ergonomic to use and type hints are sort of a suggestion, albeit available at runtime.

Closest I've seen is Zod, but the syntax looks horrendous IMO. Maybe you look past it eventually though.

parent sk0g 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton