In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
What this article shares to you is about how to deal with SpringBoot and integrate Swagger2. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
Yesterday, several netizens in the group encountered some difficulties in SpringBoot's integration of Swagger2. I hope I can help solve it. I have written a tutorial here by the way, hoping to help more beginners!
Swagger, also known as Brother Silk, claims to allow programmers to write code while producing interface documents. Therefore, it is deeply loved by Everbright programmers. At present, the most commonly used are Swagger2 and SpringBoot, so my article focuses on these two frameworks!
Before we begin, let's talk about the problem of the netizen in the group yesterday. "No operations defined in spec!" the reason for this problem is that we did not configure the package scanned by Swagger2 correctly. You can get a lot of answers to this question through Baidu. Therefore, sometimes programming for Baidu is also a shortcut!
If you haven't seen the video above, you haven't understood it. Then you can continue to read my article.
The first step in integration is to introduce pom configuration.
The second step in the integration is to open Swagger2 using the @ EnableSwagger2 annotation.
The annotation for @ EnableSwagger2 can also be written on the configuration class, either of which is fine.
At this point, the integration of the two frameworks is complete. Start the project, visit the ui interface of Swagger2, and you can see the interface documentation.
For the above two interfaces, I corrected the Chinese name of the interface through comments. This is more convenient for us to develop and read!
There are not many common annotations in Swagger2, as listed below:
The above is how to deal with SpringBoot integration Swagger2, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.