Repository navigation
[OpenAPI] Fix MapOpenApiEndpoints not resolving a single named schema - #10443
Merged
Merged
Conversation
`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.
Contributor
There was a problem hiding this comment.
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.
Contributor
Patch coverage100.0% of changed lines covered (6/6)
Project coverage: 58.8% (298960/508121 lines) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.