Available Config Rules
EasyYapi provides a rich set of configuration rules to customize API documentation generation.
Rule Format
Rules are defined as key-value pairs in the config file:
properties
rule.key=rule_valueSome rules support Groovy scripts for advanced customization:
properties
rule.key=groovy:'''
// Groovy script
it.name() + " - custom suffix"
'''API Rules
| Rule | Description |
|---|---|
| api.name | Set API name |
| api.open | Set whether API is public |
| api.status | Set API status |
| api.tag | Set API tags |
Class Rules
| Rule | Description |
|---|---|
| class.doc | Set class documentation |
| class.is.ctrl | Determine if class is a controller (alias for class.is.spring.ctrl) |
| class.is.spring.ctrl | Determine if class is a Spring controller |
| class.is.feign.ctrl | Determine if class is a Feign client |
| class.is.jaxrs.ctrl | Determine if class is a JAX-RS resource |
| class.is.quarkus.ctrl | Determine if class is a Quarkus resource |
| class.is.grpc | Determine if class is a gRPC service |
| class.prefix.path | Set class prefix path |
Field Rules
| Rule | Description |
|---|---|
| field.default.value | Set field default value |
| field.demo | Set field example value |
| field.doc | Set field documentation |
| field.ignore | Ignore field |
| field.mock | Set field mock value |
| field.name | Set field name |
| field.name.prefix | Set field name prefix |
| field.name.suffix | Set field name suffix |
| field.required | Set whether field is required |
| field.order | Set field order |
| field.order.with | Set field order by comparator |
| field.advanced | Set field advanced info |
| field.max.depth | Set max recursion depth for fields |
Method Rules
| Rule | Description |
|---|---|
| method.doc | Set method documentation |
| method.return | Set method return type |
| method.return.main | Specify field for @return doc placement |
| method.content.type | Set content type |
| method.default.http.method | Set default HTTP method |
| method.additional.header | Add additional request headers |
| method.additional.param | Add additional parameters |
| method.additional.response.header | Add additional response headers |
Param Rules
| Rule | Description |
|---|---|
| param.default.value | Set param default value |
| param.demo | Set param example value |
| param.doc | Set param documentation |
| param.http.type | Set param HTTP type |
| param.ignore | Ignore param |
| param.name | Set param name |
| param.required | Set whether param is required |
| param.type | Set param type |
| param.mock | Set param mock value |
| param.max.depth | Set max recursion depth for params |
Enum Rules
| Rule | Description |
|---|---|
| enum.use.custom | Custom enum value |
JSON Rules
| Rule | Description |
|---|---|
| json.rule.convert | Type conversion |
| json.additional.field | Add additional fields |
| json.unwrapped | Handle @JsonUnwrapped |
Other Rules
| Rule | Description |
|---|---|
| folder.name | Set folder name |
| module | Set module name (alias for yapi.project) |
| ignore | Ignore API |
| path.multi | Multi-path support |
| export.after | Post-export callback |
| http.call.before | Pre-request callback |
| http.call.after | Post-request callback |
| constant.field.ignore | Ignore constant fields |
| endpoint.prefix.path | Set endpoint prefix path |
| properties.prefix | Set properties prefix |
Postman Rules
| Rule | Description |
|---|---|
| postman.host | Set Postman base URL |
| postman.prerequest | Pre-request script |
| postman.test | Test script |
| postman.class.prerequest | Class-level pre-request script |
| postman.class.test | Class-level test script |
| postman.collection.prerequest | Collection-level pre-request event |
| postman.collection.test | Collection-level test event |
| postman.format.after | Post-format event |
YApi Rules
| Rule | Description |
|---|---|
| yapi.project | Set YApi project |
| yapi.export.before | Pre-export event |
| yapi.save.before | Pre-save event |
| yapi.save.after | Post-save event |