Problems encountered when springboot is connected to springfox-swagger2, and solutions

The latest version of springfox-swagger2 is 3.0, but it is already in 2020, and the adaptation to the new version of springboot is no longer very friendly. There should be various problems when integrating springfox-swagger2 in versions above springboot2.6. Here is an example of springboot2.7.10 integrating swagger: 1. Introduce the jar file of springfox-swagger <!–swagger–> […]

Basic use of Swagger

Article directory 1. Interface documentation 2.Open API 3. Introduction to Swagger 4. Springfox 5. Basic usage of Swagger 6. Swagger-UI usage 7. Swagger configuration 1. Interface document Interface documentation is very important for both front-end and back-end developers. Especially in recent years, after the separation of front-end and back-end has become popular, interface documentation has […]

Dynamically generate swagger documents based on OpenAPI and freemarker

Foreword In spring projects, you can use springfox or springdoc to generate swagger documents by writing annotations. The following introduces a way to dynamically generate swagger documents without writing annotations. This will be applicable in certain scenarios. For example, the interface is dynamically generated, and swagger documents are generated dynamically. It cannot be generated through […]

gRPC gateway integrates swagger

1. Gateway integrates swagger 1. In order to simplify the actual combat process, the services exposed by gRPC-Gateway do not use https, but http, but swagger-ui The calling service provided by The service is https, so you need to specify swagger in the proto file to call the service with http. When specifying files will […]

[Five: (mock data) springboot+mock integrated swaggerConfig]

Directory 1. Demo of springboot 2. Instance class 3. Service class get request method 4. Post request method of service class 5. swaggerConfig interface document generation Configuration dependencies @SpringBootApplication @ComponentScan(“com.course”) public class Application {<!– –> public static void main(String[] args) {<!– –> SpringApplication.run(Application.class,args); } } 1. Springboot Demo @Controller @EnableAutoConfiguration public class SampleController {<!– –> […]

SpringCloud uniformly configures knife4j (swagger) documents in Gateway

I used swagger before, but I felt that its interface was not very friendly, so I switched to knife4j. This interface is indeed much better. Let me show you the effect first Pay attention to the content in the red box in the upper left corner. This is the difference between single-machine documents and multi-service […]

Swagger series: Using Knife4j in SpringBoot3.x

Article directory 1. Introduction 2. Version Description 3. Use 4. Effect drawing 1. Introduction Official website: https://doc.xiaominfo.com/ Knife4j is an enhanced solution integrating Swagger2 and OpenAPI3 Knife4j is an enhanced solution for integrating Swagger to generate API documents for the Java MVC framework. It was formerly known as swagger-bootstrap-ui and is dedicated to the enhanced […]

Interface document management tool (Swagger+knife4j)

1. Quick Start with Swagger 1.1 swagger introduction Official website: https://swagger.io/Swagger is a standardized and complete Web API framework for generating, describing, calling, and visualizing RESTful-style Web services. The functions mainly include the following points:A. Makes front-end and back-end separation development more convenient and conducive to team collaboration;B. Interface documents are automatically generated online, reducing […]

Go (Gin+Gorm+swagger) builds the project framework

Original article: https://zhuanlan.zhihu.com/p/605869965 If there is any infringement, please contact me Code structure constants #define constant directory state.go db # Database connection initialization core.go handler # controller … middleware # middleware … models # models … routers #routes router.go service # Service layer, business logic processing, interacting with models to operate the database … types […]