Skip to content

Conversation

@tobias-tengler
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings December 9, 2025 11:14
@tobias-tengler tobias-tengler force-pushed the tte/openapi-refinements branch from d3aa969 to 0873da2 Compare December 9, 2025 11:15
@tobias-tengler tobias-tengler force-pushed the tte/openapi-refinements branch from 0873da2 to 9814c77 Compare December 9, 2025 11:16
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 implements support for default values in OpenAPI document generation. The changes enable GraphQL operations with default parameter values to be properly represented in the generated OpenAPI specification, allowing parameters with defaults to be optional in HTTP requests.

Key Changes:

  • Added logic to detect and propagate default values from GraphQL variables and input object fields through to OpenAPI schemas
  • Modified parameter handling to skip inserting values when defaults exist and no value is provided
  • Extended OpenAPI schema generation to include default value representations

Reviewed changes

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

Show a summary per file
File Description
TestSchema.cs Added test models (DeeplyNested, DeeplyNested2) with DefaultValue attribute for testing
OpenApiTestBase.cs Added test mutation for deeply nested object with default value in query parameter
OpenApiIntegrationTestBase.cs Added test case to verify default value handling in operation documents
HttpEndpointIntegrationTestBase.cs Added integration tests for GET and PUT operations without query parameters that have defaults
OpenApiEndpointFactory.cs Modified to extract and track whether parameters have default values
OpenApiEndpointDescriptor.cs Extended VariableValueInsertionTrieLeaf to include HasDefaultValue flag
DynamicEndpointMiddleware.cs Changed parameter insertion logic to skip values when defaults exist and no value provided
DynamicOpenApiDocumentTransformer.cs Enhanced schema generation to include default values and reordered input/output object handling
Snapshot files (multiple) Updated expected OpenAPI output to include default values in schemas
Comments suppressed due to low confidence (1)

src/HotChocolate/Adapters/src/Adapters.OpenApi.Core/Execution/DynamicEndpointMiddleware.cs:204

  • This TODO comment should be addressed before merging. If this situation should lead to a bad request, the implementation should be completed rather than leaving it as a TODO.
                    throw new InvalidOperationException(

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

🚀 Fusion Gateway Performance Results

Simple Composite Query

Constant Load (50 VUs)

Requests/sec Error Rate
5970.81 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.75ms 7.05ms 160.05ms 8.22ms 12.35ms 18.26ms

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

Requests/sec Error Rate
4585.98 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.79ms 38.88ms 247.49ms 48.51ms 109.60ms 125.92ms

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
269.62 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
12.73ms 175.33ms 593.87ms 179.96ms 226.16ms 251.42ms

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

Requests/sec Error Rate
306.48 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
3.02ms 656.51ms 1691.75ms 691.19ms 1366.93ms 1471.60ms

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
24145.42 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.09ms 1.67ms 41.52ms 2.02ms 3.85ms 4.70ms

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

Requests/sec Error Rate
19029.89 req/s 0.00%
📊 Response Time Metrics
Min Med Max Avg P90 P95
0.09ms 8.98ms 102.73ms 11.08ms 23.08ms 27.77ms

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 20061553251 • Commit 771aa37 • Tue, 09 Dec 2025 11:37:09 GMT

@tobias-tengler tobias-tengler merged commit 268bca6 into main Dec 9, 2025
114 checks passed
@tobias-tengler tobias-tengler deleted the tte/openapi-refinements branch December 9, 2025 11:45
@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

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

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

☔ 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