xtrime-ru / TelegramApiServer

Fast, simple, async php telegram api server: MadelineProto + Amp HTTP Server
https://tg.i-c-a.su
MIT License
560 stars 124 forks source link

Open API / Swagger specification #52

Open 4n70w4 opened 3 years ago

4n70w4 commented 3 years ago

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

xtrime-ru commented 3 years ago

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.

4n70w4 commented 3 years ago

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 commented 3 years ago

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

xtrime-ru commented 3 years ago

You can contact madelineProto creator @danog for additional info.

danog commented 3 years ago

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