Setting

Supported rules

    key target(context) version desc
    module class v0.7.2+ group api
    ignore class/method v0.7.2+ ignore API
    json.rule.field.name field v0.7.2+ Set the output field name(while the field name used in JSON is inconsistent with the field name in the class)
    json.rule.field.ignore field v0.7.2+ Ignore fields (the field will be skipped from the serialized output)
json.rule.convert - v0.7.2+ Mark some type conversions to other type processing, usually when spring's custom type converter is used
    json.rule.enum.convert class v1.2.0+ Special conversion for enumeration types
doc.field field v0.7.2+ Additional comments for fields
    doc.method method v0.7.2+ Additional comments for method (API)
    doc.class class v1.3.0+ Additional comments for class
    doc.param arg v1.3.0+ Additional comments for parameter
    param.required arg v0.7.3+ Whether the API parameter is required (NotNull)
    param.ignore arg v1.3.0+ Ignore API parameter
    param.default.value arg v1.3.0+ Default value for API parameter
    method.additional.header method v1.3.0+ API requires additional headers
{name: "header name",value: "",desc: "",required:false, example:""}
    method.additional.param method v1.3.0+ API requires additional parameters
{name: "param name",value: "defaultValue",desc: "",required:false}
    method.additional.response.header method v1.3.0+ API response contains additional headers
{name: "header name",value: "",desc: "",required:false, example:""}
    field.required field v0.7.3+ Whether the field is required (NotNull)
    field.default.value - v1.7.1+ The default value of a field
    mdoc.class.filter class v0.9.5+ Filter classes which can export method documents(rpc)
    mdoc.method.filter method v0.9.5+ Filter methods which can export method documents(rpc)
    class.prefix.path class v1.3.0+ Set base path for APIs in the class
    constant.field.ignore field v1.3.8+ ignore constant field
method.return.main method v1.3.8+ The core body of the return value
method.return method v1.6.1+ The type of return value
    api.name method v1.4.1+ the name of api
    method.default.http.method method v1.4.2+ the default httpmethod of the API
    postman.host class v1.5.2+ Set the host of API (for 'postman' only)

Supported Simple Configurations

Simple configurations without context

    key target(context) version desc
    dev v2.2.1+ bool Enables development mode, providing more detailed logs.
    max.deep v2.3.6+ int Sets the maximum depth for json parsing, default is 6.
    max.elements v2.3.6+ int Sets the maximum field count for json parsing, default is 256.
    json.cache.disable v2.1.0+ bool Disables json parsing cache.
    http.timeOut v2.1.0+ int Sets the http request timeout (s), prioritized over setting.
    ignore_static_and_final_field v2.1.0+ bool By default, the plugin ignores static final fields. Set to false to change this behavior.
    ignore_irregular_api_method v2.5.4+ bool By default, the plugin ignores API methods with names matching basic Object method names. Set to false to change this behavior.
    doc.source.disable v2.5.5+ bool Set to true to prevent the plugin from reading comments.

Supported Callbacks

Some callback methods might not have it, but additional context may be available for use.

    key target(context) version desc
    api.class.parse.before class None v2.2.8+
    api.class.parse.after class None v2.2.8+
    api.method.parse.before method None v2.2.8+
    api.method.parse.after method None v2.2.8+
    api.param.parse.before param None v2.2.8+
    api.param.parse.after param None v2.2.8+
    export.after method api v2.0.1+
    http.call.before None request v1.9.0+
    http.call.after None request, response v1.9.0+
    json.class.parse.before class None v2.2.8+
    json.class.parse.after class None v2.2.8+
    json.field.parse.before field None v2.2.8+
    json.field.parse.after field None v2.2.8+

Simple rules

  • # Read tag on comment

    /**
     * @fake
     */
    
  • @ Read annotation

    • @xxx Read annotations on methods or fields
    @RequestMapping("path")
    public class FakeClass{...}
    
    • @xxx#yyy Read attr value in annotation on method or field
    @RequestMapping(value = "path")
    public class FakeClass{...}
    

Advanced script rules

  • groovy rule: groovy:groovyScript

  • js rule: js:jsScript

    It is recommended to use groovy as the first choice because the JS engine may be missing after jdk11.

  • Tools / objects are available in scripts: tools

  • Debug Script : Deubg