Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit focus mode

Generate an OpenAPI spec

  • 2024-11-12
Feedback

In this article

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:

  1. In the configuration file, enable theOpenApiSpecGeneratorPlugin plugin:

    {  "plugins": [    {      "name": "OpenApiSpecGeneratorPlugin",      "enabled": true,      "pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"    }  ]  // [...] shortened for brevity}
  2. 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}

    Tip

    To create better OpenAPI specs, consider using a local language model with Dev Proxy. For more information, seeUse a local language model.

  3. Start Dev Proxy:

    devproxy
  4. Start recording requests by pressingr

  5. Perform the requests you want to include in the OpenAPI spec

  6. Stop recording requests by pressings

  7. 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.

Screenshot of two command prompt windows. One shows Dev Proxy recording API requests. The other shows the generated OpenAPI spec.

Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, seeour contributor guide.

Feedback

Was this page helpful?

YesNo

In this article

Was this page helpful?

YesNo