3 ms·
Quicktype – Beautiful types from JSON
- pedalpete 9y agoLooks like a lot of work went into this, at first I didn't understand where it would be valuable. Then I clicked on the "multiple" tab, and I kinda get it. Throw a bunch of data at it and it will build your types. I've just started using typescript so will give the vscode a go.
- dvdsgl 9y agoAwesome! Thanks for trying it out, the VS Code extension is brand new and we've not had much feedback.
- chrisparton1991 9y agoThis could be useful as a build tool plugin to generate consistent typings for frontend and backend code. Of course, using this as a build-time codegen tool means you can't add any custom annotations or methods etc., so it could be a bit restrictive for most use cases. Nice work though!
- erydo 9y agoHey, this is really cool! Cross-language validation of data types is such a pain. This looks really well-done.
- anthonybullard 9y agoThe only problem I see with this is that it doesn't have support for optional types. This is nice to be able to distinguish between null/empty fields and defaults. But this is very nice work regardless and will be useful in.many people's usecases.
- dvdsgl 9y agoYes, it does have support for optional types. See the evolution fields in the Pokedex sample! Output in TypeScript or Swift to make this clearer (some languages don't have built-in types or syntax for nullable types).