Skip to content

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_value

Some rules support Groovy scripts for advanced customization:

properties
rule.key=groovy:``` 
// Groovy script
it.name() + " - custom suffix"
```

Value Formats

The engine decides how a value is evaluated by the value's shape, not by the key — there is no per-key execution mode. The same key can be written in any of the formats below; pick by whether the value is static, already present on the element, or must be computed from project code.

FormatMeaningExample
(literal)Value injected as-is (default); multi-line values in triple backticksfield.ignore=true
groovy:Run a Groovy script with the it context; its result becomes the valuemethod.additional.header=groovy: it.name()
@Fqn / @Fqn#attrPull a value from an annotation on the element (default attribute value())method.doc=@io.swagger.v3.oas.annotations.Operation#description
#tagPull a value from a JavaDoc/KDoc tag on the elementmethod.return=#return
${n}Substituted with a #regex: filter's captured groupsjson.rule.convert[#regex:ApiResult<(.*?)>]=${1}

Filters vs. values

Do not confuse the filter tokens ($class:, @, #tag, #regex:, !) inside [...], which decide whether a rule applies, with the same @ / # tokens in the value position, which source the value from the element.

API Rules

RuleDescription
api.nameSet API name
api.openSet whether API is public
api.statusSet API status
api.tagSet API tags

Class Rules

RuleDescription
class.docSet class documentation
class.is.ctrl deprecatedDetermine if class is a controller (alias for class.is.spring.ctrl)
class.is.spring.ctrlDetermine if class is a Spring controller
class.is.feign.ctrlDetermine if class is a Feign client
class.is.jaxrs.ctrlDetermine if class is a JAX-RS resource
class.is.quarkus.ctrlDetermine if class is a Quarkus resource
class.is.grpcDetermine if class is a gRPC service
class.prefix.pathSet class prefix path

Field Rules

RuleDescription
field.default.valueSet field default value
field.demoSet field example value
field.docSet field documentation
field.ignoreIgnore field
field.mockSet field mock value
field.nameSet field name
field.name.prefixSet field name prefix
field.name.suffixSet field name suffix
field.requiredSet whether field is required
field.orderSet field order
field.order.withSet field order by comparator
field.advancedSet field advanced info
field.max.depthSet max recursion depth for fields

Method Rules

RuleDescription
method.docSet method documentation
method.returnSet method return type
method.return.mainSpecify field for @return doc placement
method.content.typeSet content type
method.default.http.methodSet default HTTP method
method.additional.headerAdd additional request headers
method.additional.paramAdd additional parameters
method.additional.response.headerAdd additional response headers

Param Rules

RuleDescription
param.default.valueSet param default value
param.demoSet param example value
param.docSet param documentation
param.http.typeSet param HTTP type
param.ignoreIgnore param
param.nameSet param name
param.requiredSet whether param is required
param.typeSet param type
param.mockSet param mock value
param.max.depthSet max recursion depth for params

Enum Rules

RuleDescription
enum.use.customCustom enum value

JSON Rules

RuleDescription
json.rule.convertType conversion
json.additional.fieldAdd additional fields
json.unwrappedHandle @JsonUnwrapped

Other Rules

RuleDescription
folder.nameSet folder name
module deprecatedSet module name (alias for yapi.project)
ignoreIgnore API
path.multiMulti-path support
export.afterPost-export callback
http.call.beforePre-request callback
http.call.afterPost-request callback
constant.field.ignoreIgnore constant fields
endpoint.prefix.pathSet endpoint prefix path
properties.prefixSet properties prefix

Postman Rules

RuleDescription
postman.hostSet Postman base URL
postman.prerequestPre-request script
postman.testTest script
postman.class.prerequestClass-level pre-request script
postman.class.testClass-level test script
postman.collection.prerequestCollection-level pre-request event
postman.collection.testCollection-level test event
postman.format.afterPost-format event

YApi Rules

RuleDescription
yapi.projectSet YApi project
yapi.export.beforePre-export event
yapi.save.beforePre-save event
yapi.save.afterPost-save event

Channel-specific rules

OpenAPI

RuleDescription
openapi.info.titleDocument title
openapi.info.versionDocument version
openapi.info.descriptionDocument description
openapi.server.urlURL for the OpenAPI servers entry
openapi.hostLegacy alias for the server URL
openapi.format.afterEvent that runs after formatting and before serialization

Hoppscotch

RuleDescription
hopp.hostCollection host override
hopp.prerequest, hopp.class.prerequest, hopp.collection.prerequestEndpoint, class, and collection pre-request scripts
hopp.test, hopp.class.test, hopp.collection.testEndpoint, class, and collection response tests
hopp.format.afterEvent that runs after collection formatting

ApiPost

RuleDescription
apipost.projectTarget project id; overrides the one configured in the ApiPost settings
apipost.hostApiPost open API base URL override; only ever assembles open API requests
apipost.server.urlBase URL of the documented API, written to the document's host/base_path
apipost.export.beforeEvent that fires once before the export starts
apipost.save.beforeEvent that fires before an endpoint is pushed; the document binding can be mutated
apipost.save.afterEvent that fires after an endpoint is pushed; content and result are exposed

Custom framework

Custom is a disabled-by-default framework whose extraction is controlled by custom.* rules. The main keys are custom.class.is.api, custom.method.is.api, custom.http.method, custom.path, and the custom.param.* binding/name rules. It also provides custom.class.parse.before, custom.class.parse.after, custom.method.parse.before, custom.method.parse.after, and custom.export.after lifecycle hooks.

See Custom Framework for a worked example and the migration from the old mdoc.* generic-export keys.

Released under the Apache-2.0 License.