Skip to content

[OpenAPI] Add OpenAPI adapter#8886

Merged
tobias-tengler merged 40 commits intomainfrom
tte/open-api
Nov 12, 2025
Merged

[OpenAPI] Add OpenAPI adapter#8886
tobias-tengler merged 40 commits intomainfrom
tte/open-api

Conversation

@tobias-tengler
Copy link
Member

No description provided.

@tobias-tengler tobias-tengler marked this pull request as ready for review November 12, 2025 07:22
Copilot AI review requested due to automatic review settings November 12, 2025 07:22
@github-actions
Copy link
Contributor

🚀 Fusion Gateway Performance Results

Simple Composite Query

Requests/sec Error Rate
4669.73 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95 P99
1.06ms 9.42ms 161.73ms 10.55ms 14.44ms 20.86ms 0.00ms

Executed Query

fragment User on User {
  id
  username
  name
}

fragment Review on Review {
  id
  body
}

fragment Product on Product {
  inStock
  name
  price
  shippingEstimate
  upc
  weight
}

query TestQuery {
  topProducts(first: 5) {
    ...Product
    reviews {
      ...Review
      author {
        ...User
      }
    }
  }
}

Variable Batching Throughput

Requests/sec Error Rate
21585.94 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95 P99
0.10ms 1.85ms 49.07ms 2.27ms 3.88ms 5.54ms 0.00ms

Executed Query

query TestQuery_8f7a46ce_2(
  $__fusion_1_upc: ID!
  $__fusion_2_price: Long!
  $__fusion_2_weight: Long!
) {
  productByUpc(upc: $__fusion_1_upc) {
    inStock
    shippingEstimate(weight: $__fusion_2_weight, price: $__fusion_2_price)
  }
}

Variables (5 sets batched in single request)

[
  { "__fusion_1_upc": "1", "__fusion_2_price": 899, "__fusion_2_weight": 100 },
  { "__fusion_1_upc": "2", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 },
  { "__fusion_1_upc": "3", "__fusion_2_price": 15, "__fusion_2_weight": 20 },
  { "__fusion_1_upc": "4", "__fusion_2_price": 499, "__fusion_2_weight": 100 },
  { "__fusion_1_upc": "5", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 }
]

No baseline data available for comparison.


Run 19289634204 • Commit 5a1b607 • Wed, 12 Nov 2025 07:31:10 GMT

Copy link
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 adds an OpenAPI adapter to HotChocolate, enabling GraphQL schemas to be exposed as OpenAPI/REST endpoints. The adapter supports mapping GraphQL operations to HTTP endpoints with validation, hot-reloading, and both standalone and Fusion gateway scenarios.

Key changes:

  • New OpenAPI adapter implementation with document parsing, validation, and transformation
  • Support for fragment documents and operation documents with GraphQL-to-OpenAPI mapping
  • Comprehensive validation rules for operations, routes, parameters, and directives
  • Test infrastructure with Xunit2/Xunit3 support and extensive integration/validation tests

Reviewed Changes

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

Show a summary per file
File Description
OneOfMutableDirectiveDefinition.cs Added description for @OneOf directive
FusionScalarTypeDefinition.cs Added SerializationType mapping for built-in scalar types
GraphQLQueryBenchmark.cs Updated namespace from Exporters.Csv to Adapters.Csv
Xunit3.Directory.Build.props New test configuration for Xunit3 projects
Xunit2.Directory.Build.props New test configuration for Xunit2 projects
ValidationTests.cs Test class for standalone validation scenarios
ValidationTestBase.cs Base class with 872 lines of validation tests
FusionValidationTests.cs Test class for Fusion gateway validation
TestServerSession.cs Test infrastructure for managing test servers
TestHelpers.cs Helper methods and test schema setup
OpenApiTestBase.cs Base test class with storage and JWT helpers
Multiple snapshot files Expected OpenAPI JSON outputs for various scenarios
OpenApi adapter core files Implementation of parsing, validation, storage, execution

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

🚀 Fusion Gateway Performance Results

Simple Composite Query

Requests/sec Error Rate
4600.10 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95 P99
0.93ms 9.53ms 161.70ms 10.71ms 14.31ms 20.49ms 0.00ms

Executed Query

fragment User on User {
  id
  username
  name
}

fragment Review on Review {
  id
  body
}

fragment Product on Product {
  inStock
  name
  price
  shippingEstimate
  upc
  weight
}

query TestQuery {
  topProducts(first: 5) {
    ...Product
    reviews {
      ...Review
      author {
        ...User
      }
    }
  }
}

Variable Batching Throughput

Requests/sec Error Rate
21670.20 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95 P99
0.10ms 1.85ms 51.60ms 2.26ms 3.83ms 5.52ms 0.00ms

Executed Query

query TestQuery_8f7a46ce_2(
  $__fusion_1_upc: ID!
  $__fusion_2_price: Long!
  $__fusion_2_weight: Long!
) {
  productByUpc(upc: $__fusion_1_upc) {
    inStock
    shippingEstimate(weight: $__fusion_2_weight, price: $__fusion_2_price)
  }
}

Variables (5 sets batched in single request)

[
  { "__fusion_1_upc": "1", "__fusion_2_price": 899, "__fusion_2_weight": 100 },
  { "__fusion_1_upc": "2", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 },
  { "__fusion_1_upc": "3", "__fusion_2_price": 15, "__fusion_2_weight": 20 },
  { "__fusion_1_upc": "4", "__fusion_2_price": 499, "__fusion_2_weight": 100 },
  { "__fusion_1_upc": "5", "__fusion_2_price": 1299, "__fusion_2_weight": 1000 }
]

No baseline data available for comparison.


Run 19289961012 • Commit f4de428 • Wed, 12 Nov 2025 07:46:29 GMT

@tobias-tengler tobias-tengler merged commit 2bd8576 into main Nov 12, 2025
112 checks passed
@tobias-tengler tobias-tengler deleted the tte/open-api branch November 12, 2025 07:57
@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (d96e96e) to head (6116497).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #8886   +/-   ##
============================
============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant