Generate an OpenAPI spec
Dev Proxy allows you to generate an OpenAPI spec from the intercepted API requests and responses. Using Dev Proxy you can quickly create an OpenAPI spec for an existing API and benefit from the tooling that supports OpenAPI.
To generate an OpenAPI spec using Dev Proxy:
In the configuration file, enable the
OpenApiSpecGeneratorPlugin
plugin:{ "plugins": [ { "name": "OpenApiSpecGeneratorPlugin", "enabled": true, "pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll" } ] // [...] shortened for brevity }
In the configuration file, to the list of URLs to watch, add the URL of the API for which you want to generate an OpenAPI spec:
{ "urlsToWatch": [ "https://api.example.com/*", ] // [...] shortened for brevity }
Start Dev Proxy without failing requests:
devproxy --failure-rate 0
Start recording requests by pressing
r
Perform the requests you want to include in the OpenAPI spec
Stop recording requests by pressing
s
Dev Proxy generates an OpenAPI spec and saves it to a file in the current directory. Dev Proxy names the file after the host name of the API followed by the current date and time, for example:
api.example.com-20231219091700.json
.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for