Skip to content

Update deps. Closes #1637#1647

Open
waldekmastykarz wants to merge 1 commit intodotnet:mainfrom
waldekmastykarz:update-deps
Open

Update deps. Closes #1637#1647
waldekmastykarz wants to merge 1 commit intodotnet:mainfrom
waldekmastykarz:update-deps

Conversation

@waldekmastykarz
Copy link
Copy Markdown
Collaborator

@waldekmastykarz waldekmastykarz commented May 8, 2026

Update deps. Closes #1637

Copilot AI review requested due to automatic review settings May 8, 2026 12:27
@waldekmastykarz waldekmastykarz requested a review from a team as a code owner May 8, 2026 12:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Dev Proxy’s .NET dependencies (notably System.CommandLine, Microsoft.OpenApi, EF Core, Azure SDK, OpenTelemetry, and Swashbuckle) and applies the required API migrations across CLI command handling and OpenAPI parsing/serialization paths in the main app, abstractions, and plugins.

Changes:

  • Bump core dependencies across DevProxy, DevProxy.Abstractions, and DevProxy.Plugins (plus lockfiles) to newer major/minor versions.
  • Migrate CLI integration to newer System.CommandLine APIs (parser configuration, help actions, invocation).
  • Migrate OpenAPI usage to Microsoft.OpenApi 3.x APIs (parsing, HTTP method model, async serialization) across generation and reporting plugins and the Graph DB loader.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
DevProxy/packages.lock.json Updates locked dependency graph for the DevProxy app.
DevProxy/DevProxy.csproj Bumps direct package references for the DevProxy app.
DevProxy/Commands/StdioCommand.cs Adjusts parsing configuration to disable response file expansion with updated System.CommandLine APIs.
DevProxy/Commands/HelpExamples.cs Updates help example output handling for new System.CommandLine APIs.
DevProxy/Commands/ExitCodeHelpAction.cs Adapts help action termination/output behavior to new System.CommandLine API shape.
DevProxy/Commands/DevProxyHelpAction.cs Updates root help output handling for new System.CommandLine APIs.
DevProxy/Commands/DevProxyCommand.cs Updates command invocation to match new System.CommandLine invocation signature.
DevProxy.Plugins/Reporting/MinimalPermissionsPlugin.cs Switches OpenAPI spec loading/parsing to OpenApiDocument.Parse and updates null handling.
DevProxy.Plugins/Reporting/MinimalPermissionsGuidancePlugin.cs Switches OpenAPI parsing to OpenApiDocument.Parse and adjusts server handling.
DevProxy.Plugins/Reporting/ApiCenterProductionVersionPlugin.cs Adds null-safety around OpenAPI Servers usage.
DevProxy.Plugins/Reporting/ApiCenterMinimalPermissionsPlugin.cs Updates OpenAPI namespace usage and adds null-safety in logging.
DevProxy.Plugins/packages.lock.json Updates locked dependency graph for the plugins project.
DevProxy.Plugins/Models/ApiCenterModels.cs Updates OpenAPI namespace usage to Microsoft.OpenApi.
DevProxy.Plugins/Generation/OpenApiSpecGeneratorPlugin.cs Migrates OpenAPI generation/serialization to Microsoft.OpenApi 3.x and adds new spec versions.
DevProxy.Plugins/Generation/ApiCenterOnboardingPlugin.cs Updates operation lookup to match new OpenAPI HTTP method model.
DevProxy.Plugins/Extensions/OpenApiDocumentExtensions.cs Updates extension namespace/types and security scheme handling for OpenAPI 3.x model.
DevProxy.Plugins/Extensions/ApiCenterExtensions.cs Migrates API Center OpenAPI parsing and adds null-safety around servers/URLs.
DevProxy.Plugins/DevProxy.Plugins.csproj Bumps plugin package references to updated versions.
DevProxy.Plugins/ApiCenter/ApiCenterClient.cs Updates DefaultAzureCredential options (credential chain behavior change).
DevProxy.Abstractions/packages.lock.json Updates locked dependency graph for the abstractions project.
DevProxy.Abstractions/DevProxy.Abstractions.csproj Bumps abstractions package references and switches from OpenApi.Readers to OpenApi.
DevProxy.Abstractions/Data/MSGraphDb.cs Migrates Graph OpenAPI loading and GET-operation detection to the new OpenAPI method model.

Comment thread DevProxy.Plugins/Generation/OpenApiSpecGeneratorPlugin.cs
Comment thread DevProxy/DevProxy.csproj
@waldekmastykarz waldekmastykarz force-pushed the update-deps branch 2 times, most recently from 34b4b32 to 3e1355f Compare May 8, 2026 12:35
@waldekmastykarz waldekmastykarz changed the title Update deps Update deps. Closes #1637 May 8, 2026
@garrytrinder
Copy link
Copy Markdown
Contributor

Hey @waldekmastykarz, I've been testing this PR and found three runtime issues — the build compiles clean but things break at runtime.

Bug 1 — Swagger JSON returns HTTP 500

Swashbuckle 10.1.7 depends on Microsoft.OpenApi 2.4.1, but this PR ships Microsoft.OpenApi 3.5.3. The ABI changed between v2 and v3, causing a MissingMethodException at runtime:

System.MissingMethodException: Method not found: 
'IDictionary`2<String,OpenApiMediaType> IOpenApiRequestBody.get_Content()'

GET /swagger/v1/swagger.json returns 500. Swashbuckle 11.x with OpenApi 3.x support doesn't exist yet (draft PR). This is a known incompatibility.

Since Swashbuckle is only used for the proxy's control API documentation and doesn't affect any user-facing plugins, we should replace it with ASP.NET Core's built-in MapOpenApi(). The project already targets net10.0, so it's available out of the box and removes the third-party version conflict entirely.

Bug 2 — OpenApiSpecGeneratorPlugin generates zero specs

In OpenApi v3, new OpenApiPathItem().Operations is null (was an initialized empty dictionary in v1). The code at OpenApiSpecGeneratorPlugin.cs:258 does path.Operations?.Add(method, operation) which silently no-ops. Every request then hits the pathItem.Operations is null guard and is skipped. No spec files are generated at all.

Fix: initialize Operations explicitly on construction, e.g. var path = new OpenApiPathItem { Operations = new Dictionary<HttpMethod, OpenApiOperation>() };

Bug 3 — devproxy msgraphdb fails with "Format 'yaml' is not supported"

OpenApi v3 split YAML support into a separate package. OpenApiDocument.LoadAsync(stream, "yaml") throws NotSupportedException. The fix is to add Microsoft.OpenApi.YamlReader 3.5.3 and register it via settings.AddYamlReader() before parsing. Same issue would affect MinimalPermissionsPlugin, MinimalPermissionsGuidancePlugin, and ApiCenterExtensions which all use OpenApiDocument.Parse(content, null) — the null format defaults to JSON, so YAML specs would silently fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate to Microsoft.OpenApi v2+ and Swashbuckle 10.x

3 participants