You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the OpenApiSpecGeneratorPlugin to record requests that are responded to using the CRUD API or mocked response plugins an error is thrown.
Expected behaviour
OpenAPI spec is generated
Actual behaviour
Error is thrown
Error processing request GET
http://api.contoso.com/products
System.Exception: Response body is not read yet. Use SessionEventArgs.GetResponseBody() or SessionEventArgs.GetResponseBodyAsString() method to read the response body.
at Titanium.Web.Proxy.Http.Response.EnsureBodyAvailable(Boolean throwWhenNotReadYet)
at Titanium.Web.Proxy.Http.RequestResponseBase.get_Body()
at Titanium.Web.Proxy.Http.RequestResponseBase.get_BodyString()
at Microsoft.DevProxy.Plugins.RequestLogs.OpenApiSpecGeneratorPlugin.SetResponseFromSession(OpenApiOperation operation, Response response)
at Microsoft.DevProxy.Plugins.RequestLogs.OpenApiSpecGeneratorPlugin.GetOpenApiPathItem(SessionEventArgs session)
at Microsoft.DevProxy.Plugins.RequestLogs.OpenApiSpecGeneratorPlugin.AfterRecordingStop(Object sender, RecordingArgs e)
Steps to reproduce
Create config file that uses OpenApiSpecGeneratorPlugin and either the MockResponsePlugin or CRUDApiPlugin
Start devproxy using --config-file option and --record flag
Send request to API (request is output in console as mocked)
{
"$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v0.17.1/mockresponseplugin.schema.json",
"mocks": [
{
"request": {
"method": "GET",
"url": "http://api.contoso.com/products"
},
"response": {
"body": [
{
"productCode": "CTOQAD",
"productName": "Contoso Quad",
"description": "A state-of-the-art drone designed for the enterprise market. With its advanced flight controls and high payload capacity, it’s perfect for a variety of commercial applications. Its robust design ensures reliable performance in challenging conditions.",
"targetMarket": "Enterprise",
"priceUSD": 5000
},
{
"productCode": "EGLAIR",
"productName": "Eagle Air",
"description": "A high-performance drone built for enterprise use. It offers exceptional flight time and range, making it ideal for large-scale operations. Its advanced camera and sensor systems provide high-quality aerial data.",
"targetMarket": "Enterprise",
"priceUSD": 6000
},
{
"productCode": "GMBLCS",
"productName": "Gimbal Case",
"description": "Durable and lightweight case designed to protect your drone during transport. Compatible with a variety of drone models, it features a custom foam interior to ensure a secure fit.",
"targetMarket": "Consumer",
"priceUSD": 100
},
{
"productCode": "MRK8DR",
"productName": "Mark8",
"description": "Consumer-grade drone that combines ease of use with advanced features. It offers stable flight, high-quality video capture, and a range of intelligent flight modes.",
"targetMarket": "Consumer",
"priceUSD": 800
},
{
"productCode": "MRK8CR",
"productName": "Mark8 Controller",
"description": "Designed to provide precise control over your Mark8 drone. Its ergonomic design and intuitive controls make it easy to pilot your drone, while its built-in display keeps you informed about your drone’s status.",
"targetMarket": "Consumer",
"priceUSD": 150
}
]
}
}
]
}
The text was updated successfully, but these errors were encountered:
Description
When using the
OpenApiSpecGeneratorPlugin
to record requests that are responded to using the CRUD API or mocked response plugins an error is thrown.Expected behaviour
OpenAPI spec is generated
Actual behaviour
Error is thrown
Steps to reproduce
OpenApiSpecGeneratorPlugin
and either theMockResponsePlugin
orCRUDApiPlugin
devproxy
using--config-file
option and--record
flagDev Proxy Version
0.17.1
Operating system (environment)
Windows
Shell
PowerShell
Configuration file
Additional Info
The text was updated successfully, but these errors were encountered: