Import OpenAPI (Swagger) spec
Apidog supports importingjson
oryaml
files inOpenAPI 3
andSwagger-2
data formats.
Ifsummary
,operationId
andpath
parameters are all written within the same Swagger file, then during the import, the endpoint name will be set according to the priority ofsummary > operationId > path
.
Manual Import
Open theSettings
and click onImport Data
to select either file import or URL import.
Manual Import - File Import
You can either drag and drop yourJSON
orYAML
files into the area shown below, or simply click the area to browse and select the desired file from your system’s file manager.
Manual Import - URL Import
When using URL import, please provide the direct URL to theJSON
orYAML
data file, not the Base URL of the Swagger UI.
Import - Advanced Settings
The imported OpenAPI/Swagger specifications include only endpoints, schemas, and environments.
When importing a file, you can set up the following options:
- Forder: Support importing files into specific folders.
- Overwrite: When two files have the same Method and Path, the newer file will overwrite the older file.
Merge: When two files have the same Method and Path, any modified information from the old file, such as Mock rules, parameter descriptions, request examples, and response examples, will be retained.
Overwrite Selected Fields: When two files have the same Method and Path, you can choose to overwrite specific fields. Other unselected fields will retain the existing data in Apidog.
Ignore: When two files have the same Method and Path, the new file will not be imported.
Keep Both: When two files have the same Method and Path, the new file will be imported, and the old file will not be deleted.
Import Cases: When this option is enabled, the test cases under the selected endpoints will be automatically selected by default. You can also manually choose the corresponding test cases in the import preview.
Schema
need to be configured separately, including the selection of overwrite modes and the import folders.
To align the structure of your existing endpoints in Apidog with the folder structure of an imported Swagger file, simply enable theAnd update endpoint folder
option. This will automatically adjust the current folder structure to match the imported file.
Scheduled Import
Open theSettings
panel, go toImport Data
, and click onScheduled
. You can select multiple data sources here and synchronize them to a specific folders at regular intervals.
:::tip
TheImport Data
option is only visible and accessible to project admins.
:::