BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News DevProxy 0.24 Adds More OpenAPI Options

DevProxy 0.24 Adds More OpenAPI Options

This item in japanese

Log in to listen to this article

Microsoft has released version 0.24 of DevProxy, an API simulation command-line tool. The new version improves its compatibility with different OpenAPI specifications and adds a few improvements for daily tasks.

DevProxy (formerly known as Microsoft 365 Developer Proxy) helps developers to add resilience to their API-related code by simulating a vast number of API and network behaviours. By default, the tool acts as a proxy that fails half the time. It can also simulate throttling, rate-limiting or slow API responses. It can be used to mock responses to specific APIs. Combined with dev tunnels CLI, a ngrok-like tool, it can also inspect cloud services communication to understand what messages are being passed in cloud calls.

The new improvements are mostly centered on the OpenAPI generator. DevProxy can generate an OpenAPI specification from the intercepted requests and responses. However, it would only export the specification in JSON format and using the OpenAPI v3 standard.

It’s now possible to specify either a JSON or a YAML output for the generated OpenAPI specification file. This is controlled by a OpenApiSpecGeneratorPlugin configuration file placed in the DevProxy application folder under plugins. The file has the following format:

{
  "openApiSpecGeneratorPlugin": {
    "includeOptionsRequests": false,
    "specVersion": "v3_0",
    "specFormat": "Json"
  }
}

The specFormat property allows to choose between Json or Yaml formats. The specVersion property allows to choose between v3_0 and v2_0 OpenAPI standards.

In the Microsoft ecosystem, the Power Platform connectors use the OpenAPI v2 standards, which until now wasn’t supported by DevProxy. The new version helps Power Platform developers to create connectors for Power Apps and Power Automate flows.

To use DevProxy, developers have to configure the application URLs to mock and modify in the configuration file. This can be cumbersome if the application calls many URLs when running. DevProxy 0.24 adds a preset in the configuration that allows DevProxy to keep track of the connections that the browser (or any process name or ID) makes. They are exported to a text file for easy copying and pasting into the configuration file.

Screenshot of DevProxy URL discoverer

Another small feature added in version 0.24 is printing out the timestamp for each captured request with a time attribute.

DevProxy output highlighting the intercepted request timestamp

Finally, the developers fixed a bug in the DevProxy that would throw an exception when running in a script, as opposed to running in an interactive command line. The accompanying Visual Studio Code extension for maintaining configuration files, called Dev Proxy Toolkit, has been updated to v0.16, making sure that the new DevProxy configuration file schema is applied.

DevProxy is an open-source project on GitHub. The complete release notes for this version are available on the site. There are 21 contributors and 50 open issues at the moment. The project has been starred 583 times.

About the Author

BT