Hacker News new | ask | show | jobs
by alpy 695 days ago
It would be interesting to know how it works for you in a real project. I often have to create types for undocumented endpoints, but it's always a guessing game. Without a proper spec or reading the source code, it's impossible to know if a field is nullable or not, or to distinguish a real text field from a string based enum
1 comments

Yeah I agree that it is impossible to know exactly what the fields are without a real documented source, but I figured this could be a decent option when there are no other alternatives available. While it's not perfect, it can provide a starting point for creating types based on sample data, which can then be refined as you work with the API and gain more understanding.