Skip to content

[OpenAPI] Fix MapOpenApiEndpoints not resolving a single named schema - #10443

Merged
tobias-tengler merged 2 commits into
mainfrom
tte/fix-openapi-named-schema-resolution
Sep 28, 2026
Merged

tobias-tengler merged 2 commits into
mainfrom
tte/fix-openapi-named-schema-resolution

Conversation

@tobias-tengler

Copy link
Copy Markdown
Member

No description provided.

`AddOpenApi()` now always registers a named `OpenApiSetup` entry, so
`OpenApiManager.Names` discovers the schema even when the storage is not
configured through `AddOpenApiDefinitionStorage(...)`. Before, calling
`MapOpenApiEndpoints()` without a schema name fell back to `_Default`
and threw at startup.

Adds tests for a single and multiple named schemas on the HotChocolate
server and the Fusion gateway, plus MCP regression tests for a single
named schema.
Copilot AI lite review requested due to automatic review settings September 28, 2026 15:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The changes are covered by integration tests and no blocking issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Fixes named schema resolution for OpenAPI and MCP endpoints when storage is configured separately.

Changes:

  • Registers named OpenAPI setup entries.
  • Updates GraphQL and Fusion builders.
  • Adds OpenAPI and MCP integration coverage.
File Summary
src/​HotChocolate/​Adapters/​test/​Adapters.OpenApi.Tests/​Endpoints/​HttpEndpointIntegrationTests.cs Tests named OpenAPI resolution.
src/​HotChocolate/​Adapters/​test/​Adapters.OpenApi.Tests/​Endpoints/​FusionHttpEndpointIntegrationTests.cs Tests Fusion OpenAPI resolution.
src/​HotChocolate/​Adapters/​test/​Adapters.Mcp.Tests/​FusionIntegrationTests.cs Tests Fusion MCP resolution.
src/​HotChocolate/​Adapters/​test/​Adapters.Mcp.Tests/​CoreIntegrationTests.cs Tests MCP schema resolution.
src/​HotChocolate/​Adapters/​src/​Fusion.Adapters.OpenApi/​Extensions/​OpenApiFusionGatewayBuilderExtensions.cs Registers setup for Fusion gateways.
src/​HotChocolate/​Adapters/​src/​Adapters.OpenApi/​Extensions/​OpenApiRequestExecutorBuilderExtensions.cs Registers setup for GraphQL servers.
src/​HotChocolate/​Adapters/​src/​Adapters.OpenApi.Core/​Extensions/​InternalServiceCollectionExtensions.cs Registers named OpenAPI configuration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

The single named schema tests now also serve the OpenAPI document through
`AddGraphQLTransformer()` and check that it resolves the named schema.
@github-actions

Copy link
Copy Markdown
Contributor

Patch coverage

100.0% of changed lines covered (6/6)

File Covered Changed Patch %
…/Extensions/InternalServiceCollectionExtensions.cs 4 4 100.0% 🟢
…/Extensions/OpenApiRequestExecutorBuilderExtensions.cs 1 1 100.0% 🟢
…/Extensions/OpenApiFusionGatewayBuilderExtensions.cs 1 1 100.0% 🟢

Project coverage: 58.8% (298960/508121 lines)

@tobias-tengler
tobias-tengler merged commit 83ca702 into main Sep 28, 2026
305 of 307 checks passed
@tobias-tengler
tobias-tengler deleted the tte/fix-openapi-named-schema-resolution branch September 28, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants