Jaguar-dart / client

Contains various packages for client side
46 stars 22 forks source link

Generate Swagger spec #5

Open tejainece opened 6 years ago

tejainece commented 6 years ago

Generate swagger specification from Retrofit.

jaumard commented 6 years ago

Generally there two mode with Swagger :) either it's generated from the backend side on the fly depending on server implementation (introspection) or the swagger first approach (I consider it the best ^^) where people write manually the Swagger specification and from it generate models (for backend/frontend/mobile) but can also generate directly the retrofit implementation.

Would be nice to be able to work with those two mode :) But I don't think it should belong to retrofit, should mainly belong the jaguar server

My two cents ^^

tejainece commented 6 years ago

Retrofit specification is basically swagger spec. It is much harder on Jaguar server side unless we go swagger first.

jaumard commented 6 years ago

Problem is that your swagger definition might not be exhaustive then, because it just depends on what you implement frontend side and not what's implemented server side. And it force you to build the front part to provide backend documentation which look weird to me.

What I've done with nodeJS is Swagger first approach, generate models from swagger definition, then when the server start, it:

And my plan was to add:

To put in place swagger first support it's a big work, but once it's done you gain a lot because basically all the stuff is done just by writing your swagger file, then you just need to implement your business logic and your backend side is ready. It's very powerful