Generate PHP readonly DTOs and TypeScript types from a JSON payload

php dev.to

Integrating an API usually starts the same way: copy a JSON response, write a PHP DTO for it, then write the same shape again as a TypeScript interface. It's slow, and it's easy to get nullable fields wrong. Now, with AI this became a bit easier, but as we learn how to do agentic programming, we also try to limit the manual prompting. To help myself, and hopefully to help you, I created a tool for this kind of 'problem' -> https://jsontodto.dev/. It runs in the browser, so the JSON isn't uploa

Read Full Tutorial open_in_new
arrow_back Back to Tutorials