HNHacker News
TopNewBestAskShowJobs

dvdsgl

321 karma · joined July 8, 2014

submissionscomments
dvdsgl··on JSON Schema
Creating a JSON schema for your data and committing it is a great way to codify assumptions about the data consumed or produced by your program. Once you have a JSON schema for your data, you can generate models and serializers in many languages with quicktype: https://app.quicktype.io#s=coordinate
dvdsgl··on Convert React JavaScript Code to TypeScript with Proper Typing
quicktype (https://app.quicktype.io/) can generate TypeScript types from JSON, Schema, and GraphQL, and it also emits a runtime type representation to do dynamic typechecking. Perhaps this isn't exactly what you're looking for but you could easily modify it to generate whatever code you'd like. We have an experimental Handlebar-based templating feature to make customizing the generated code easier.
dvdsgl··on Quicktype – Beautiful types from JSON
Awesome! Thanks for trying it out, the VS Code extension is brand new and we've not had much feedback.
dvdsgl··on Quicktype – Beautiful types from JSON
Yes, 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).
dvdsgl··on Ask HN: What did you work on in 2017?
Woot! Glad you found it useful.

Is there anything we can improve?

dvdsgl··on Ask HN: What did you work on in 2017?
A friend and I created https://quicktype.io to generate TypeScript, Swift, Go, C#, C++, etc. from JSON sample data and GraphQL queries.

Many have tried to solve this problem – we've found at least 20 projects that attempt to turn JSON sample data into code to represent that data, but they're almost all abandoned and they all have the same fundamental flaws (they generate invalid code for most non-trivial inputs).

In the past two weeks we've created Xcode and VS Code plugins. I've had so much fun with this project! We'd love to create a business around quicktype but we haven't figured that part out yet.

dvdsgl··on Show HN: Quicktype – it's like Uber, but for JSON
Looks like our click target for the close icon is way too small. Will fix, thanks for reporting!
dvdsgl··on Show HN: Quicktype – it's like Uber, but for JSON
Sorry to hear that! What browser are you using? Do you get an error on your console?
dvdsgl··on Show HN: Quicktype – it's like Uber, but for JSON
It was a joke—quicktype has basically nothing in common with Uber. I couldn't find a way to describe quicktype within the stringent title length limit so I went with the "Uber for X" cliché as a provocative gag :)
dvdsgl··on Show HN: Quicktype – it's like Uber, but for JSON
Good morning!

quicktype infers types from sample JSON data, then outputs strongly typed models and serializers for working with that data in your desired programming language. In short, quicktype makes it a breeze to work with JSON type-safely.

For an in-depth explanation of what makes quicktype useful, special, and interesting, see http://blog.quicktype.io/debut/

Thank you for your consideration and feedback!

← PreviousPage 3 of 3