-
Notifications
You must be signed in to change notification settings - Fork 370
Deprecating swagger-tools #335
Comments
When this issue is closed, that means all of the replacement projects are in place and ready to be used. Until then, this is just a place for discussion on the topic. |
Thanks @whitlockjc for posting this. The deprecation did come as bit of of a surprise. We have had no major issues with swagger-tools. Only few times we had issues with new versions not being compatible with Trireme. Did not know about sway-connect at all. Looking forward to it! |
I'm not saying I won't support swagger-tools for those using it. :) It's just that swagger-tools started out as one thing and became three. So while I use the term "deprecated", I'm really breaking the project up and rewriting where necessary since that would be a good time. As for swagger-tools not having any major issues, there are a number that bug me and I hate that they aren't fixed already, especially since they are fixed in Sway. But to fix them would require breaking the existing APIs which means rewriting things, etc. I just figured breaking the project up into separate repos was a good time to revisit this. I hope this all makes sense, I am by no means walking away from swagger-tools and I hope that those projects that replace it are better than what we have now. |
Sounds reasonable. Maybe a swagger-tools org needs to rise up - I've got some ideas around codegen for this. For example where I am, we are generating from the YAML a set of server-side entities, and also controller classes that map to methods that are called with just the parameter values, like a 'real' function (rather than having to deep-dive into req.swagger-parms) - and then automatically mapping back to the appropriate HTTP response code based on the type of JSON object being returned. Theres probably other better ideas. -Steve |
I may create a sway organization, that's a good idea. |
If there's room for a gulp-task in there, let me know. I've written some codegen stuff to wrap around the controller classes. It's effectively generating definitions and controllers that are supposed to plug into swaggerRouter, and then call a much simpler-looking implementation class. It's published up at: ES6 (I know some folks will go 'ick!' but cross-testing on <= 4.0 didn't feel overly worthwhile immediately). |
If you use the swagger-tools middleware, feel free to help guide its replacement: https://github.com/whitlockjc/sway-connect/issues |
Hey @whitlockjc! From what I've understood in this thread you're going to split the project in multiple modules and correct some of the APIs. I need a project like swagger-tools (or its replacement) so I looked around and found this : https://github.com/kogosoftwarellc/express-openapi. I'm wondering where the split is going and how it will differ from express-openapi? Do you have any details on the roadmap and usage examples? Thx... |
Hello @hsablonniere! swagger-tools is nearly 2 years old and has been heavily used/tested. The official swagger-node project from the original Swagger owners uses swagger-tools for its middleware and so do many others. I tell you this because swagger-tools already got an established track record and is in use by many people. I also do not see any problem with using swagger-tool as-is as the new sway-connect replacement will have migration documentation from swagger-tools to sway-connect. As for express-openapi, I've never heard it until you brought it up. It seems that the project only 1.5 months old. I'm not sure why someone would want to reinvent the wheel by creating another Swagger/OpenAPI driven middleware but competition is always good and to each their own. That being said, I've no opinion on that project as I've not used it. As for swagger-tools, there are a number of middlewares provided by swagger-tools, all documented here, and I will make sure that the new module containing these middlewares are least replace the functionality swagger-tools provides. As far as how it's going, it's coming along quite nice but it's taking longer than it could because I'm doing my best to solicit community feedback: https://github.com/whitlockjc/sway-connect/issues All of this being said, I hope to make sway-connect, and the rest of sway-* middlewares, as good or better than what swagger-tools provides. I hope to use the 2 years of feedback and learning to make it the best middleware it can possibly be. Just know that swagger-tools being "deprecated" is really not the case, we're just breaking our project up into specific npm modules and using that time to revisit design decisions and to make things better. Any feature in swagger-tools now will be available in the replacement modules albeit in a better shape. I hope this helps. |
@whitlockjc Thanks very much for the feedbacks and details. |
@hsablonniere I'm watching that thread to see if I can get some information as well. I want you to have enough information to use what makes sense for you, even if it's not my project. |
@whitlockjc Fair enough, thanks very much. |
Any updates on this @whitlockjc ? |
I apologize @amcdnl but I've been assigned to other things at work and I've not had much time to get the middleware done. I've got this started here and it shouldn't take much work but I've just not had the time recently. I am working on some improvements and bug fixes for json-refs which will mean a new sway release, with improvements and bug fixes. So if you need an API for loading/validating/... Swagger document, sway is more than ready. If you need the middleware, I'm still not done but I will be working on it soon. |
@whitlockjc If I were looking at starting a fresh project today, would you recommend using swagger-express-mw (as is pushed by the swagger-node cli generator) or continue to use swagger-tools ? |
I say, if it works use it because I will be fixing the middleware bugs either here or in the new project. |
Thank you for your thoughts on the subject. I'll stick with using swagger-tools for now as that is what some of our other projects already use, and keep an eye on this ticket. When the full migration path is ready I'll make the jump then. |
@whitlockjc would you say that the stack, that you mention in the initial post, is ready to be used in production now? I.e would you recommend people migrating of swagger-tool and onto that stack? I am currently looking at stating a new project and have been playing around with swagger-tools and only found this post because of you comment on #443 Do you know of an examples/tutorials that use the mentioned replacement stack / workflow? Thanks! |
|
@whitlockjc using We have a few APIs using it, and especially one is becoming quite large (I think @140 endpoints already). Of course, we are going to split it in smaller APIs, but it does not make sense for now. To manage this API, we've split the swagger yaml in multiple files. Eg: we have a models folder, we have one swagger file defining the route per controller folder and in the end it all comes together in one main file, via $refs. To combine all the refs we used Now, I didn't spend time to investigate if it's from Thanks and keep up the great work! |
The benchmark was ran on a document that use to take ~48 minutes So yes, the time spent resolving references in |
To quantify the document used for benchmarking:
|
@whitlockjc are there any examples about how to use |
I'm embarrassed to point you to sway-connect due to its dormancy but it was the planned project for migrating the |
No worries, for now we are happy with Also, the documentation is very helpful to get an in-depth view, but I think it would be great to have also some "getting started" code examples, to be able to get started and test the framework as fast as possible. Cheers |
Thanks for the feedback. I am currently working on the |
Hi I'm not sure if this the right place to ask about the current roadmap. I'm using |
For over a year now, the need to rewrite swagger-tools has been apparent. Not only that but swagger-tools doesn't exactly adhere to the NPM best practices where each module do one specific thing since swagger-tools is an API, a CLI and Middleware. Lastly, swagger-tools started with Swagger 1.2 support and was adapted to support Swagger 2.0. This last piece is what has caused a lot of code cruft, architectural hardships, etc. It is also this last piece that is making supporting swagger-tools harder.
That being said, the plan is to deprecate swagger-tools as-is and replace each of the individual components of swagger-tools with specific NPM modules:
1.0.0
has been ready for weeks and is just waiting on sway-connect to be completed to flush out any remaining bugs.)*I realize that this might come as a shock to some but I've been talking about this for quite some time. Issues like #327, #227 and others have mention of this plan in it as well. Without a rewrite, swagger-tools just can't fix some of these bugs and rewriting software that's already been replaced makes no sense. I welcome your feedback.
The text was updated successfully, but these errors were encountered: