knife4j is an enhanced solution for generating API documentation for the Java MVC framework integration Swapper, formerly known as swagger-bootstrap-ui, named knife4j in the hope that it will be as small, lightweight, and powerful as a dagger! Its underlying layer is the encapsulation of Springfox, which is used in the same way as Springfox, but the interface document UI is optimized.
Core functionality:
Modify the application-linkis.yml file setting to knife4j.production=false
knife4j: enable: true production: false
Modify the linkis.properties file to open test mode
wds.linkis.test.mode=true wds.linkis.test.user=hadoop
After restarting all services, you can access the knife4j page via http://ip:port/api/rest_j/v1/doc .html
http://ip:port/api/rest_j/v1/doc.html
Modify the application-linkis.yml file setting to knife4j.production=false
knife4j: enable: true production: false
Modify the linkis.properties file to add wds.linkis.server.user.restful.uri.pass.auth
wds.linkis.server.user.restful.uri.pass.auth=/api/rest_j/v1/doc.html,/api/rest_j/v1/swagger-resources,/api/rest_j/v1/webjars,/api/rest_j/v1/v2/api-docs
After restarting all services, you can access the knife4j page via http://ip:port/api/rest_j/v1/doc .html
http://ip:port/api/rest_j/v1/doc.html
Since identity authentication is required when knife4j debugs each interface, the following cookie information needs to be manually added to the browser.
#User login ticket-id bdp-user-ticket-id= #Workspace ID workspaceId= #Internal request switch dataworkcloud_inner_request=true
Take the Chrome browser as an example
Access knife4j page via http://ip:port/api/rest_j/v1/doc.html Click the interface name to display detailed interface documentation
Click “Debug” and enter parameters to debug the interface
For detailed usage guidelines, please visit the knife4j official website to view:https://doc.xiaominfo.com/knife4j/