Skip to content

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

@waldekmastykarz

Description

@waldekmastykarz

Summary

Upgrade Microsoft.OpenApi from 1.6.x to 2.x+ and Swashbuckle.AspNetCore from 8.1.1 to 10.x.

Why

Swashbuckle 10.x pulls in Microsoft.OpenApi 2.4.1 as a transitive dependency. OpenApi v2 is a complete rewrite — types like OpenApiDocument, OpenApiSchema, OperationType, IOpenApiExtension were moved or removed from their v1 namespaces. At runtime, .NET resolves to the highest version (v2 from Swashbuckle), causing TypeLoadException for every OpenApi v1 type the codebase uses.

Currently both packages are pinned to their old versions to avoid this conflict.

Scope

8 files across DevProxy.Abstractions and DevProxy.Plugins use OpenApi v1 types (~89 call sites):

  • DevProxy.Plugins/Generation/OpenApiSpecGeneratorPlugin.cs (heaviest user — uses Microsoft.OpenApi.Any, .Extensions, .Interfaces, .Writers)
  • DevProxy.Plugins/Reporting/MinimalPermissionsPlugin.cs
  • DevProxy.Plugins/Reporting/MinimalPermissionsGuidancePlugin.cs
  • DevProxy.Plugins/Reporting/ApiCenterMinimalPermissionsPlugin.cs
  • DevProxy.Plugins/Generation/ApiCenterOnboardingPlugin.cs
  • DevProxy.Plugins/Models/ApiCenterModels.cs
  • DevProxy.Plugins/Extensions/ApiCenterExtensions.cs
  • DevProxy.Abstractions/Data/MSGraphDb.cs

Key breaking changes in OpenApi v2

  • Microsoft.OpenApi.Any namespace removed
  • Microsoft.OpenApi.Extensions namespace removed/reorganized
  • Microsoft.OpenApi.Interfaces removed (IOpenApiExtension gone)
  • Microsoft.OpenApi.Writers removed/replaced
  • OpenApiDocument, OpenApiSchema, OpenApiPathItem, OperationType moved or redesigned
  • OpenApiStreamReader replaced with new reading API

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions