Auto‑Generate Spring API Docs in IDEA with Apifox Helper Plugin
Learn how to install and configure the Apifox Helper plugin in IntelliJ IDEA to automatically generate, sync, and debug Java Spring API documentation, offering a zero‑intrusion alternative to Swagger with built‑in mock and testing features.
Developers often avoid writing API documentation, but the Apifox Helper plugin for IntelliJ IDEA can automatically sync interface docs while you code, keeping front‑end and test teams up‑to‑date.
Step 1: Install the plugin
Search for "Apifox Helper" in the IDEA plugin marketplace and install it. This plugin generates documentation without modifying your code.
Open IDEA > Preferences (Settings) > Plugins, search for Apifox Helper, and click Install. If the download is slow, download directly from the JetBrains Marketplace.
After installation you can either sync to an Apifox project or export a Markdown file. To sync, download or register the Apifox client and create a corresponding project.
Registration/Download: http://apifox.cn/b3macro1
Create a project: click "Create Team" > "New Project" and enter a project name.
We strongly recommend syncing to an Apifox project.
Step 2: Associate the IDEA project with the Apifox project
After installing the plugin, configure the token in Preferences > Apifox Helper. You need to provide three pieces of information:
Apifox server address: default
https://api.apifox.cn(no change needed).
Apifox personal access token: obtain it from your Apifox account settings under "API Access Token" and paste it into the plugin settings.
Module project ID: copy the project ID from Apifox project settings > Basic Settings and enter it for the corresponding module.
Once configured, the plugin will automatically generate and update documentation; you only need to set it up once per project.
Step 3: Automatically generate API documentation
1. Open a Controller file, right‑click and select "Upload to Apifox".
2. In the Apifox project you will see the newly synced documentation.
3. When the API code changes, click "Upload to Apifox" again to sync.
Additional feature: In‑IDEA debugging
The plugin lets you launch API tests directly from IDEA. Select an API file, right‑click "Call API", and the request is sent without leaving the IDE.
For special requirements—such as ignoring certain APIs or customizing folder names—refer to the official Apifox documentation for configuration file options.
How does it differ from Swagger?
Swagger requires extensive annotations that intrude on business logic and offers limited functionality. Apifox uses standard Javadoc comments, achieving zero‑intrusion, and also supports importing Swagger docs, API mocking, and automated testing.
Why create an Apifox project?
Sharing a project link is easier than exporting Markdown files, and updates are automatically synchronized for all collaborators.
Apifox also provides powerful mock capabilities, customizable document layout, and automated testing with test case generation and workflow control.
Convenient debugging
Front‑end developers can click "Run" directly in the documentation to test APIs without copying parameters.
Cloud mock
Apifox can generate intelligent mock data; enable the mock feature in the doc and open the generated link to obtain mock responses.
Document layout design
You can customize navigation menus, login buttons, and other UI elements to match your product’s style.
Automated testing
Testers can generate multiple test cases for each API, simulate success and failure scenarios, and design workflow controls such as loops, conditions, and waits.
Apifox offers a cohesive experience for developers, front‑end engineers, and testers, eliminating the need for multiple tools like Postman or Swagger.
Official website: http://apifox.cn/b3macro1
macrozheng
Dedicated to Java tech sharing and dissecting top open-source projects. Topics include Spring Boot, Spring Cloud, Docker, Kubernetes and more. Author’s GitHub project “mall” has 50K+ stars.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.