Edit

Share via


TypeSpecGeneratorPlugin

Generates TypeSpec files from the intercepted requests and responses.

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

Plugin instance definition

{
  "name": "TypeSpecGeneratorPlugin",
  "enabled": true,
  "pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
  "configSection": "typeSpecGeneratorPlugin"
}

Configuration example

{
  "typeSpecGeneratorPlugin": {
    "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.27.0/typespecgeneratorplugin.schema.json",
    "ignoreResponseTypes": false
  }
}

Configuration properties

Property Description Default
ignoreResponseTypes Determines whether to generate types for API responses (false) or to set them to string (true). false

Command line options

None

Remarks

To create better TypeSpec files, consider using a local language model with Dev Proxy. Using a local language model, the TypeSpecGeneratorPlugin generates clearer operation IDs and descriptions, giving you a better starting point for your TypeSpec file. To use a local language model with the TypeSpecGeneratorPlugin, enable the language model in the configuration file. For more information, see Use a local language model.