Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate Swagger spec #5

Open
tejainece opened this issue Aug 28, 2018 · 3 comments
Open

Generate Swagger spec #5

tejainece opened this issue Aug 28, 2018 · 3 comments

Comments

@tejainece
Copy link
Member

Generate swagger specification from Retrofit.

@jaumard
Copy link
Contributor

jaumard commented Aug 29, 2018

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
Copy link
Member Author

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

@jaumard
Copy link
Contributor

jaumard commented Aug 29, 2018

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:

  • load the swagger definition
  • generate and map routes from it
  • setup the validation (param, header, body) from it
  • setup auth from it
  • server swagger ui and definition

And my plan was to add:

  • validation/verification of the response
  • generation of integration test automatically to test routes and validations

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants