TelegramApiServer icon indicating copy to clipboard operation
TelegramApiServer copied to clipboard

Open API / Swagger specification

Open 4n70w4 opened this issue 5 years ago • 5 comments
trafficstars

Hi! It would be very convenient to have a swagger file with a description of all requests and responses.

It would also automatically generate client libraries for any programming language.

https://editor.swagger.io/

image

4n70w4 avatar Oct 08 '20 10:10 4n70w4

Its a big task... Need to put all these methods in editor: https://docs.madelineproto.xyz/API_docs/methods/

I cant do it. But will gladly approve such pull request.

xtrime-ru avatar Oct 08 '20 10:10 xtrime-ru

Perhaps this can be somehow automated.

May be need to parse *.json and *.tl files from https://github.com/danog/schemas and generate a swagger.yml based on it.

I assume the documentation repository https://github.com/danog/MadelineProtoDocs is also generated automatically. But I have not yet figured out where the generator code is. One could take it as a basis.

Do you have any information about this?

4n70w4 avatar Oct 08 '20 16:10 4n70w4

Okay, I found https://github.com/danog/MadelineProto/tree/master/tools/build_docs

In the near future I will look this and it may turn out on the basis of this to a proof of concept for swagger.yml generator

4n70w4 avatar Oct 08 '20 16:10 4n70w4

You can contact madelineProto creator @danog for additional info.

xtrime-ru avatar Oct 09 '20 06:10 xtrime-ru

Seems like fun, I'll take a look tomorrow, if I finish the phpdoc generator, first)))

danog avatar Oct 09 '20 21:10 danog