json-schema-viewer icon indicating copy to clipboard operation
json-schema-viewer copied to clipboard

Consider adding option to generate TypeScript typings for object type(s)

Open michalczukm opened this issue 4 years ago • 2 comments

While playing with some external APIs the most annoying thing is to write types for it, or manually generating them from json-schema by external lib.

In lot of simple scenarios you'd like just to grab type for particular response for one endpoint. From UI perspective, it could be just a button on object. Eventually - an option to generate all types based on json-schema (which might be simpler to be fair) image

michalczukm avatar Jan 22 '21 09:01 michalczukm

Cool idea! What do you see as the value of this over somebody just using https://www.npmjs.com/package/json-schema-to-typescript themselves? (Not saying that it's a bad idea, just trying to clarify)

robertmassaioli avatar Jan 23 '21 06:01 robertmassaioli

I'm also using json-schema-to-typescript in those cases :D The idea is to basically run it from the page/docs level. Why? To lower the entry of using API with TS codebase (one click on page while you're in context VS using small small cli util)

michalczukm avatar Jan 23 '21 13:01 michalczukm