Knife4j 2.0 release, Nirvana rebirth ~!

Knife4jPredecessor was swagger-bootstrap-uinamed knife4j want her to be like a dagger compact, lightweight, and features powerful, renamed also want her to make a universal solution Swagger interface documentation services, not just focus on the front Ui front-end. Although still only in the front, but after the function is certainly more than that.

2.0The main version is to use the Vue+ Ant Design Vueon the front Ui rewrite, this version is a true separation of the front and rear end version, while relying on Vuetechnology ecology, there will be more interesting features to achieve, to meet all the needs of developers.

Documentation: http://doc.xiaominfo.com

Effect (older version): http://swagger-bootstrap-ui.xiaominfo.com/doc.html

Effect (version 2.0): http://knife4j.xiaominfo.com/doc.html

Gitee: https://gitee.com/xiaoym/knife4j

GitHub:https://github.com/xiaoymin/swagger-bootstrap-ui

Example: https://gitee.com/xiaoym/swagger-bootstrap-ui-demo

Characteristics & Optimization

knife4j-spring-ui

1, using the Vue + Ant Design Vue to rewrite Ui, unified whole style interface, clearer documentation capabilities and the ability to debug interfaces

2, support for offline export Markdown in the interface, the document off-line Html format, Markdown, Html style before have done a more extreme optimization, Markdown format mainly for tree Model show by way of indentation in the table md format display more intuitive, Html documents offline and online style is almost no difference, simple and intuitive. click preview to export off-line Html effect

3, single-copy document interface documentation page is by duplicating the problem Markdown format, above the main table md optimized format display problems, indented way to display a tree form

4, debugging bar is optimized to distinguish the request header and request body parameters, use the tab tab components can request parameters dynamically add, maintain, if you use the document caching, dynamic debugging parameters of the document page will be long-lasting treatment .

5, the configuration of personalized documents (enhancement) have cut, leaving only the current four functions, i.e., (request parameter buffer, repeating the same type of interface was filtered, the local caching open tab interfaces, document enhancement)

. 6, Tab tab to open the interface right can be closed according to a different tab selected Tab

7, debugging box request headers, request bodies support dynamic parameters, developers can add their own parameters for debugging dynamic, more flexible and convenient

8, provides enhanced direct access to the address http://ip:port/doc.html#/plus, the address of the back-end can be used directly in the case of enhanced annotation ensure open, you do not need to be configured in the front-end customized configuration, making it easy team to communicate directly

9, increased to 141 in response to the download type species, almost covering the current common file types

10, the repair will attribute the extra double quotes response body bug gitee # I125B2 , GitHub # 156

Question 11, the repair request parameter data does not show the type of format for a Long distinguish int64, int32- GitHub # 161

12, to solve the problem in the case a plurality of field SwaggerModels Schema response status code is not displayed github # 170

13, a debug request additional Ui default request header Request-Origion, the value Knife4j, the original value SwaggerBootsrapUi, make a change in version 2.0.

14, when solving Models attribute too much nesting, page whiteboard, efficiency github # 106

If you backend is Java + Spring technology stack, while the use of springfox, like a change of Swagger Ui skin, can be introduced by the pom.xml directly as follows:

<dependency>
  <groupId>com.github.xiaoymin</groupId>
  <artifactId>knife4j-spring-ui</artifactId>
  <version>2.0.0</version>
</dependency>

Knife4j-Spring

1, remove the enhanced annotation @EnableSwaggerBootstrapUi, future enhancements Open comments Use@EnableKnife4j

2, knife4j-spring-boot-starterassembly remove the default springfox of ui-jar package springfox-swagger-ui, leaving only knife4j-spring-uithe developer if you want to use springfox the ui package needs to introduce itself in the project

3, the merger PR12- repair IDEA debug the problem can not be displayed Response of dynamic , dynamic class loading can not fix the problem of

Use SpringBoot technology stack can be quickly incorporated by reference starter is used, note that the starter assembly comprising Ui as follows:

<dependency>
  <groupId>com.github.xiaoymin</groupId>
  <artifactId>knife4j-spring-boot-starter</artifactId>
  <version>2.0.0</version>
</dependency>

If this is the case of micro-services, micro-services actually do not need references Ui jar package, only need to reference the jar package depends Ui at the gateway, so in the case of micro-services, to enhance the use of property only need to reference the micro-service version of the starter dependence, as follows:

<dependency>
    <groupId>com.github.xiaoymin</groupId>
    <artifactId>knife4j-micro-spring-boot-starter</artifactId>
    <version>2.0.0</version>
</dependency>
​

Feature

  • Based on documents Vue + Ant Design build, more powerful, clean interface documentation capabilities, and the ability to debug interfaces

  • About layout, component-based multi-document Tabs review style

  • Online support exporting a variety of formats Html, Markdown, Word, PDF and other documents offline

  • Interface sorting, grouping and sorting capabilities to support interfaces

  • Interface support global online search function

  • Swagger resources to provide protection strategy to protect document security

  • Interface parameters unlimited debugging support, developers debugging is very flexible and dynamically add, delete parameter

  • Global cache debugging information, refresh the page still exists, enabling developers to easily debug

  • In a more humane tree component table showing functions Swagger Models

  • You can display multiple documents in a multi-tab interface documentation way

  • Request parameter field type of request, whether the color-coded Required

  • Rough statistics the number of different types of interfaces homepage

  • Global support custom function parameters, including the home page header and query both types

  • JSR-303 annotations annotations support

  • More personalization function

interface

Display interface interface documentation as follows:

Commissioning interface as follows:

Swagger Models feature

Offline support export Markdown, Html function, form markdown than the previous version by reducing displayed as a tree structure, the effect is as follows:

Exported by a third-party PDF software Markdown effect as shown below:

While providing off-line Html export function, style and function interface Html online almost no difference, beautiful, elegant, simple, as shown below:

Star & Issue

Thank you for the support of friends, go https://gitee.com/xiaoym/knife4j point of a Star it ~ ~ :)

At last

This version is based on the rewritable Vue, there is substantial risk of ill-considered inevitable for some problems, in the process we use if there is a problem also welcome the timely adoption issues and communicate with me, will be amended as soon as possible, thank you ~! !

Guess you like

Origin www.oschina.net/news/112095/knife4j-2-0-released