หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Generates OpenAPI spec in JSON format from the intercepted requests and responses.
Configuration example
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/rc.schema.json",
"plugins": [
{
"name": "OpenApiSpecGeneratorPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
"configSection": "openApiSpecGeneratorPlugin"
}
],
"openApiSpecGeneratorPlugin": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.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.
Next step
Dev Proxy