A
A
Alex2018-12-10 16:03:25
API
Alex, 2018-12-10 16:03:25

How to describe a tipi for a third party API?

There is a third-party site with an open API. I would like to describe each method once, its parameters and response, so that in the future in other projects, regardless of whether TS or JS is used, I would be able to "connect" these types so that both the compiler and the IDE know about them and use them. Well, upload it somewhere (npm, github) so that other people, if they wish, can “connect” these types in the same way and use them.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
@
@antoo, 2018-12-12
_

You may find something like JSON Schema useful: this is a description of the fields in the form of JSON, from which you can back-generate types in any language. For JS and TypeScript, there should be ready-made solutions. You can play around here: https://app.quicktype.io/#l=schema

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question