Export data programmatically
A
Amir Ahmetovic
We're trying to create a tool that would compare Swagger JSON file generated from our TypeScript codebase to the Swagger JSON expored from Apidog and raise a flag when there are any differences between API documentation and API implementation.
However, it seem that there is no way to programmatically export data from Apidog as we want to automate the process of checking any discrepancies.
It would be nice if Apidog itself has an API that we could use to manage Apidog projects or at the very least for Apidog CLI to be able to export project data.
Md Mamunur Rashid
Hi Amir Ahmetovic,
Good day,
Thank you for your query. Based on your issue, could you please consider adding a permanent link to the OpenAPI spec file on the project overview page? This would greatly assist in comparing it with the file generated by Swagger JSON from the TypeScript codebase.
To add a permalink, kindly follow these steps:
Open Apidog and navigate to the Overview section.
Under API Specification, you’ll find the Permalink option. Once you click it, a mini window will pop-up and there you can copy the URL and open it in the browser (refer to Screenshot 1).
Alternatively, you can also export the API:
Click the (...) button and select Export.
In the popup window, choose OpenAPI Spec and then click Open URL at the bottom of the window. This will open the spec in your browser (refer to Screenshot 2).and you can also add a permalink clicking the overview and there you will get a (+) sign to add custom permalink as well.
For consistency and reliability, it is recommended to use the Overview Permalink, as it serves as a permanent address.
Please feel free to ping us, we would love to assist you further if you have any more queries.
A
Amir Ahmetovic
Md Mamunur Rashid I've actually tried that and it seems like it's what we need but the problem is that it's quite buggy and crashes mock server if you provide it another project ID.
For example:
- For project #1 I click the Copy permalink and open it in the browser - this works
- For project #2 I click the Copy permalink and open it in the browser - this also works
- For project #3 I copy the project ID and replace it in the permalink - this crashes something in Apidog - Apidog app still works but it seems like it crashes the mock server because in the status bar in the app it says "Mock Server Error" and I can't start the mock server again until I close Apidog and run it again (I've attached some screenshots)
However, if for project #3 I click the Copy permalink button then it also works just fine.
If you fix the bug then I think permalink option will be exactly what we need.
A
Amir Ahmetovic
@Md Mamunur Rashid Let me know if you have any updates here.