Skip to content

Conversation

@tobias-tengler
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings January 2, 2026 20:50
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 new validation rules for OpenAPI definitions and refactors the error handling model from a result-based pattern to an exception-based pattern. The changes improve type safety by making operation and fragment definitions explicit properties rather than derived values.

Key changes:

  • Replaced result-based parsing with exception-based parsing (throws OpenApiDefinitionParsingException on errors)
  • Added two new validation rules: EndpointMustHaveOperationNameRule and EndpointHttpMethodMustBeValidRule
  • Converted OpenApiEndpointDefinition and OpenApiModelDefinition from records to classes with internal constructors and explicit OperationDefinition/FragmentDefinition properties

Reviewed changes

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

Show a summary per file
File Description
ValidationTestBase.cs Updated test to use new generic error message and added test for operation name validation
OpenApiDefinitionParserTests.cs Updated all parsing tests to expect exceptions instead of checking result objects
OpenApiTestBase.cs Updated test infrastructure to use OpenApiDefinitionValidationError instead of IOpenApiError and simplified parser usage
OpenApiCollectionArchiveTests.cs Updated to use new parser signature that returns definitions directly
ModelNoDeferStreamDirectiveRule.cs Removed definition parameter from validation error constructor
EndpointParameterConflictRule.cs Removed definition parameter from validation error constructor
EndpointNoDeferStreamDirectiveRule.cs Removed definition parameter from validation error constructor
EndpointMustHaveValidRouteRule.cs Removed definition parameter from validation error constructor
EndpointMustHaveSingleRootFieldRule.cs Removed definition parameter from validation error constructor
EndpointMustHaveNameRule.cs New validation rule to ensure endpoints have operation names
EndpointMustBeQueryOrMutationRule.cs Simplified error message and removed definition parameter from validation error constructor
EndpointHttpMethodMustBeValidRule.cs New validation rule to ensure endpoints have valid HTTP methods
OpenApiDefinitionValidator.cs Registered two new validation rules in the endpoint validation pipeline
OpenApiDefinitionValidationError.cs Simplified to only contain message, removed IOpenApiError interface and definition reference
OpenApiDefinitionParsingResult.cs Removed - no longer needed with exception-based parsing
OpenApiDefinitionParsingException.cs New exception type for parsing failures
OpenApiDefinitionParsingError.cs Removed - replaced by exception-based approach
OpenApiDefinitionParser.cs Refactored to throw exceptions on parse errors, return definitions directly, and include operation/fragment nodes as explicit parameters
IOpenApiError.cs Removed - no longer needed with simplified error model
OpenApiDiagnosticEventListener.cs Updated signature to use OpenApiDefinitionValidationError instead of IOpenApiError
IOpenApiDiagnosticEvents.cs Updated signature to use OpenApiDefinitionValidationError instead of IOpenApiError
AggregateOpenApiDiagnosticEventListener.cs Updated signature to use OpenApiDefinitionValidationError instead of IOpenApiError
OpenApiModelDefinition.cs Converted from record to class with internal constructor and explicit FragmentDefinition property
OpenApiEndpointDefinitionParameter.cs Moved to separate file (previously nested in OpenApiEndpointDefinition.cs)
OpenApiEndpointDefinition.cs Converted from record to class with internal constructor and explicit OperationDefinition property

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

🚀 Fusion Gateway Performance Results

Simple Composite Query

Constant Load (50 VUs)

Requests/sec Error Rate
5955.22 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.77ms 7.02ms 159.91ms 8.25ms 12.63ms 18.30ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
4649.74 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.70ms 37.07ms 270.29ms 47.79ms 107.75ms 125.64ms

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
      }
    }
  }
}

Deep Recursion Query

Constant Load (50 VUs)

Requests/sec Error Rate
268.12 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
12.78ms 175.32ms 736.78ms 181.02ms 228.57ms 255.09ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
309.00 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
3.02ms 683.13ms 1705.20ms 682.20ms 1372.50ms 1494.21ms

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 {
  users {
    ...User
    reviews {
      ...Review
      product {
        ...Product
        reviews {
          ...Review
          author {
            ...User
            reviews {
              ...Review
              product {
                ...Product
              }
            }
          }
        }
      }
    }
  }
  topProducts(first: 5) {
    ...Product
    reviews {
      ...Review
      author {
        ...User
        reviews {
          ...Review
          product {
            ...Product
          }
        }
      }
    }
  }
}

Variable Batching Throughput

Constant Load (50 VUs)

Requests/sec Error Rate
24045.86 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.09ms 1.67ms 53.00ms 2.03ms 3.87ms 4.73ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
18786.99 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.09ms 9.23ms 116.28ms 11.23ms 23.13ms 28.01ms

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 20666439971 • Commit 05da2f8 • Fri, 02 Jan 2026 21:08:25 GMT

@tobias-tengler tobias-tengler force-pushed the tte/openapi-validation-improvements branch from cae2f0a to b7249fd Compare January 3, 2026 14:42
@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2026

🚀 Fusion Gateway Performance Results

Simple Composite Query

Constant Load (50 VUs)

Requests/sec Error Rate
5911.02 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.77ms 7.04ms 160.45ms 8.31ms 12.73ms 18.34ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
4610.99 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.86ms 36.81ms 246.60ms 48.19ms 109.27ms 128.30ms

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
      }
    }
  }
}

Deep Recursion Query

Constant Load (50 VUs)

Requests/sec Error Rate
270.29 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
12.75ms 172.16ms 624.80ms 179.54ms 224.86ms 260.27ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
306.49 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
3.06ms 663.60ms 1706.81ms 688.18ms 1358.06ms 1464.70ms

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 {
  users {
    ...User
    reviews {
      ...Review
      product {
        ...Product
        reviews {
          ...Review
          author {
            ...User
            reviews {
              ...Review
              product {
                ...Product
              }
            }
          }
        }
      }
    }
  }
  topProducts(first: 5) {
    ...Product
    reviews {
      ...Review
      author {
        ...User
        reviews {
          ...Review
          product {
            ...Product
          }
        }
      }
    }
  }
}

Variable Batching Throughput

Constant Load (50 VUs)

Requests/sec Error Rate
24177.47 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.09ms 1.66ms 45.04ms 2.02ms 3.83ms 4.71ms

Ramping Load (0→50→500→50 VUs)

Requests/sec Error Rate
19082.62 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.09ms 8.96ms 99.92ms 11.07ms 23.11ms 27.92ms

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 20678722814 • Commit b539eec • Sat, 03 Jan 2026 15:00:30 GMT

@tobias-tengler tobias-tengler merged commit 835f30e into main Jan 3, 2026
222 of 224 checks passed
@tobias-tengler tobias-tengler deleted the tte/openapi-validation-improvements branch January 3, 2026 15:17
@codecov
Copy link

codecov bot commented Jan 3, 2026

Codecov Report

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

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

☔ 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.

2 participants