YApi Settings
IDE Settings
Configure YApi settings in the IDE:
Settings > Other Settings > EasyApi > YApi
| Setting | Description |
|---|---|
| Yapi Server | YApi server address |
| Tokens | Project tokens in module=token format (one per line) |
| Export Mode | How to handle existing APIs on export (see below) |
| Request body JSON5 | Use JSON5 format for request body (default: off) |
| Response body JSON5 | Use JSON5 format for response body (default: off) |
Additional options in the General tab:
| Setting | Default | Description |
|---|---|---|
| Enable URL Templating | true | Enable URL templating for path parameters |
| Switch Notice | true | Show notification when switching YApi project |
Getting a YApi Token
- Log in to YApi
- Go to project settings
- Copy the project Token
Token Format
Tokens are specified as module=token pairs, one per line in the IDE Tokens field. The module name is used to match APIs to the correct YApi project.
Export Mode
| Mode | Description |
|---|---|
| ALWAYS_UPDATE | Always update existing APIs (default) |
| NEVER_UPDATE | Never update existing APIs |
| ALWAYS_ASK | Show a dialog to ask whether to override each API |
| UPDATE_IF_CHANGED | Update only when the API content has changed |
Config File Rules
The following rules can be set in config files (.easy.api.config):
| Rule | Description |
|---|---|
| yapi.project | Set the YApi project for API grouping |
| yapi.export.before | Event before YApi export |
| yapi.save.before | Event before saving to YApi |
| yapi.save.after | Event after saving to YApi |
YApi Mock
EasyYapi supports syncing field mock rules to the YApi Mock service.
See YApi Mock for details.