Importing OpenAPI Specification
Apidog supports importing OpenAPI 3.1
,Swagger 1, 2, 3
data format of Json
or YAML
documents.
Manual Import
Open the Setting,
and click on "Manual Import" to select either file import or URL import.
Manual Import - File Import
You can drag and drop the JSON
or YAML
file into the area shown in the figure below, or click the area to select the corresponding JSON or YAML file from the system's file manager.
Manual Import - URL Import
When using URL import, you need to provide the URL of the JSON
or YAML
data file, not the Base URL of the Swagger UI.

Import - Advanced Settings
Importing OpenAPI/Swagger formats only includes APIs, Schemas, and environments.
API Coverage Mode
Same URL coverage: When two files have the same URL and method, the new file will overwrite the old file.
Coverage only if the URL and group are the same: When two files have the same URL and method, and they are in the same group, the new file will overwrite the old file.
Do not import if the URL is the same: When two files have the same URL and method, the new file will not be imported.
Keep both when the URL is the same: When two files have the same URL and method, the new file will be imported, and the old file will not be deleted.
Import to group: Support importing files to specific groups.
Import API test cases: After turning on the switch, all API test cases under the selected API will be selected by default, and corresponding API test cases can also be selected in the import preview.
Tip: When importing files in non-Apidog format and the API document is overwritten, API test cases with the same name will not be imported, while API test cases with different names will be added.
The data model needs to be independently configured for selecting the coverage mode and importing to groups, as shown in the image.
Starting from version 2.2.18, a new function of "Meanwhile sync folder of the API" has been added. When you need to update the API document in Apidog and want to keep the synchronization of directories with the folders in Swagger, you can turn on the switch of "Meanwhile sync folder of the API".
Automatic Import
Open the settings panel and click on "Import (Auto Sync)" to set up multiple data sources and synchronize them to specific groups at regular intervals.
Only project administrators have the "Import Data" (manual and automatic import) setting permission.
Smart Merge
Most users import OpenAPI (Swagger) data and then add names, mock rules, parameter descriptions, and return examples for the data structures in Apidog. Backend developers design APIs in Swagger, and other team members maintain, debug, and test APIs in Apidog.
To meet the above scenario and avoid the situation where the automatic/manual import completely overwrites all fields in the data source, Apidog added a "Smart Merge" feature in version 2.2.27-alpha.1.
When you are ready to import OpenAPI (Swagger) data, select "Smart Merge" in "Match Same APIs", and the names, mock rules, parameter descriptions, and return examples of the data structures modified in Apidog will be preserved.