Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Generates OpenAPI spec in JSON format from the intercepted requests and responses.
Plugin instance definition
{
"name": "OpenApiSpecGeneratorPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
"configSection": "openApiSpecGeneratorPlugin"
}
Configuration example
{
"openApiSpecGeneratorPlugin": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v1.0.0/openapispecgeneratorplugin.schema.json",
"includeOptionsRequests": false,
"ignoreResponseTypes": false,
"specVersion": "v3_0",
"specFormat": "Json",
"includeParameters": [
"api-version"
]
}
}
Configuration properties
| Property | Description | Default |
|---|---|---|
includeOptionsRequests |
Determines whether to include OPTIONS requests in the generated OpenAPI spec |
false |
ignoreResponseTypes |
Determines whether to ignore response types in the generated OpenAPI spec. | false |
specVersion |
Determines which version to use for the generated OpenAPI spec. Can be set to v2_0 or v3_0 |
v3_0 |
specFormat |
Determines which format to use for the generated OpenAPI spec. Can be set to Json or Yaml |
Json |
includeParameters |
Determines the list of query string parameters to include in the generated OpenAPI spec, along with their default values. | [] |
Command line options
None
Remarks
To create better OpenAPI specs, consider using a local language model with Dev Proxy. Using a local language model, the OpenApiSpecGeneratorPlugin generates clearer operation IDs and descriptions, giving you a better starting point for your OpenAPI spec. To use a local language model with the OpenApiSpecGeneratorPlugin, enable the language model in the configuration file. For more information, see Use a local language model.