Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
0020c60
Setup projects
tobias-tengler Oct 20, 2025
3aebe19
Api outline and test setup
tobias-tengler Oct 21, 2025
a5b8475
Basic GET
tobias-tengler Oct 21, 2025
0d75f65
Extract root response name
tobias-tengler Oct 21, 2025
36d3d49
Handle null for GET
tobias-tengler Oct 21, 2025
64ed9ac
Handle GraphQL errors
tobias-tengler Oct 21, 2025
a8516af
Handle authorization errors
tobias-tengler Oct 21, 2025
d675f0b
Handle validation errors as BadRequest
tobias-tengler Oct 22, 2025
f51a94b
wip
tobias-tengler Oct 28, 2025
d1c20f3
Add OpenApiDocumentTransformer
tobias-tengler Oct 30, 2025
071d8aa
Add more tests
tobias-tengler Oct 30, 2025
1fd64c7
Properly handle nullable fields
tobias-tengler Oct 30, 2025
797cf28
Remove properties from body that are provided through other parameters
tobias-tengler Oct 30, 2025
486cce8
More OpenAPI document generation fixes
tobias-tengler Oct 30, 2025
dfa6e66
Basic validation layout
tobias-tengler Oct 30, 2025
211c193
More fixes
tobias-tengler Oct 30, 2025
c8f5c2c
wip: support fusion
tobias-tengler Oct 31, 2025
334303b
Add IOpenApiResultFormatter
tobias-tengler Oct 31, 2025
e192826
More fixes
tobias-tengler Nov 3, 2025
d0c394b
Handle oneOf
tobias-tengler Nov 4, 2025
af96d3a
More VariableCoercion tests
tobias-tengler Nov 5, 2025
fab9648
Handle new serialization type and patterns
tobias-tengler Nov 5, 2025
0fdb932
Initialize SerializationType for spec scalars
tobias-tengler Nov 5, 2025
f800649
Merge remote-tracking branch 'origin/main' into tte/open-api
tobias-tengler Nov 5, 2025
79570a0
Implement hot reloading
tobias-tengler Nov 5, 2025
bcb1709
Add OpenApi Hot Reload tests
tobias-tengler Nov 5, 2025
df24328
Fix type generation
tobias-tengler Nov 5, 2025
4d3d5d6
Add validation
tobias-tengler Nov 6, 2025
53708fc
Add diagnostic events and validation tests
tobias-tengler Nov 8, 2025
e31ffc6
Merge remote-tracking branch 'origin/main' into tte/open-api
tobias-tengler Nov 8, 2025
f402563
Raise errors during parsing as events
tobias-tengler Nov 9, 2025
8d36e8d
Validate paths must match and that no incremental directives are used
tobias-tengler Nov 10, 2025
16fd0eb
Address todos pt.1
tobias-tengler Nov 10, 2025
2d813cd
Rename projects to Adapters
tobias-tengler Nov 10, 2025
b83eb61
Add format and pattern to schema
tobias-tengler Nov 10, 2025
5700a05
Use trie for inserting variable values
tobias-tengler Nov 10, 2025
fe81d17
Merge remote-tracking branch 'origin/main' into tte/open-api
tobias-tengler Nov 10, 2025
8ac674b
Fix more todos
tobias-tengler Nov 12, 2025
271a438
Merge remote-tracking branch 'origin/main' into tte/open-api
tobias-tengler Nov 12, 2025
6116497
Fix issue discovered in code review
tobias-tengler Nov 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/All.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,15 @@
<Folder Name="/HotChocolate/Diagnostics/test/">
<Project Path="HotChocolate/Diagnostics/test/Diagnostics.Tests/HotChocolate.Diagnostics.Tests.csproj" />
</Folder>
<Folder Name="/HotChocolate/Adapters/" />
<Folder Name="/HotChocolate/Adapters/src/">
<Project Path="HotChocolate/Adapters/src/Adapters.OpenApi/HotChocolate.Adapters.OpenApi.csproj" />
<Project Path="HotChocolate/Adapters/src/Adapters.OpenApi.Core/HotChocolate.Adapters.OpenApi.Core.csproj" />
<Project Path="HotChocolate/Adapters/src/Adapters.OpenApi.Fusion/HotChocolate.Fusion.Adapters.OpenApi.csproj" />
</Folder>
<Folder Name="/HotChocolate/Adapters/test/">
<Project Path="HotChocolate/Adapters/test/Adapters.OpenApi.Tests/HotChocolate.Adapters.OpenApi.Tests.csproj" />
</Folder>
<Folder Name="/HotChocolate/Fusion-vnext/" />
<Folder Name="/HotChocolate/Fusion-vnext/benchmarks/">
<Project Path="HotChocolate/Fusion-vnext/benchmarks/Fusion.Execution.Benchmarks/Fusion.Execution.Benchmarks.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.0-rc.2.25502.107" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="10.0.0-rc.2.25502.107" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0-rc.2.25502.107" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="10.0.0-rc.2.25502.107" />
<PackageVersion Include="Microsoft.AspNetCore.WebUtilities" Version="10.0.0-rc.2.25502.107" />
<PackageVersion Include="Microsoft.Data.Sqlite.Core" Version="10.0.0-rc.2.25502.107" />
Expand Down Expand Up @@ -106,6 +107,7 @@
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="9.0.2" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="9.0.2" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="9.0.2" />
<PackageVersion Include="Microsoft.AspNetCore.WebUtilities" Version="9.0.2" />
<PackageVersion Include="Microsoft.Data.Sqlite.Core" Version="9.0.2" />
Expand Down
12 changes: 12 additions & 0 deletions src/HotChocolate/Adapters/Adapters.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Solution>
<Folder Name="/src/" />
<Folder Name="/src/Adapters.OpenApi/">
<Project Path="src\Adapters.OpenApi.Core\HotChocolate.Adapters.OpenApi.Core.csproj" />
<Project Path="src\Adapters.OpenApi.Fusion\HotChocolate.Fusion.Adapters.OpenApi.csproj" />
<Project Path="src\Adapters.OpenApi\HotChocolate.Adapters.OpenApi.csproj" />
</Folder>
<Folder Name="/test/" />
<Folder Name="/test/Adapters.OpenApi.Tests/">
<Project Path="test\Adapters.OpenApi.Tests\HotChocolate.Adapters.OpenApi.Tests.csproj" />
</Folder>
</Solution>
8 changes: 8 additions & 0 deletions src/HotChocolate/Adapters/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..\'))" />

<PropertyGroup>
<TargetFrameworks>net10.0; net9.0</TargetFrameworks>
<LangVersion>Preview</LangVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace HotChocolate.Adapters.OpenApi;

internal sealed class AggregateOpenApiDiagnosticEventListener(IOpenApiDiagnosticEventListener[] listeners)
: IOpenApiDiagnosticEventListener
{
public void ValidationErrors(IReadOnlyList<IOpenApiError> errors)
{
foreach (var listener in listeners)
{
listener.ValidationErrors(errors);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace HotChocolate.Adapters.OpenApi;

/// <summary>
/// Register an implementation of this interface in the DI container to
/// listen to diagnostic events. Multiple implementations can be registered,
/// and they will all be called in the registration order.
/// </summary>
/// <seealso cref="OpenApiDiagnosticEventListener"/>
public interface IOpenApiDiagnosticEventListener : IOpenApiDiagnosticEvents;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace HotChocolate.Adapters.OpenApi;

/// <summary>
/// Provides diagnostic events for the OpenAPI integration.
/// </summary>
public interface IOpenApiDiagnosticEvents
{
/// <summary>
/// Called when errors occur while parsing or validating an OpenAPI document.
/// </summary>
/// <param name="errors">The errors.</param>
void ValidationErrors(IReadOnlyList<IOpenApiError> errors);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace HotChocolate.Adapters.OpenApi;

internal sealed class NoOpOpenApiDiagnosticEventListener : OpenApiDiagnosticEventListener;
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
namespace HotChocolate.Adapters.OpenApi;

/// <summary>
/// This class can be used as a base class for <see cref="IOpenApiDiagnosticEventListener"/>
/// implementations, so that they only have to override the methods they
/// are interested in instead of having to provide implementations for all of them.
/// </summary>
public class OpenApiDiagnosticEventListener : IOpenApiDiagnosticEventListener
{
/// <summary>
/// A no-op activity scope that can be returned from
/// event methods that are not interested in when the scope is disposed.
/// </summary>
protected static IDisposable EmptyScope { get; } = new EmptyActivityScope();

public virtual void ValidationErrors(IReadOnlyList<IOpenApiError> errors)
{
}

private sealed class EmptyActivityScope : IDisposable
{
public void Dispose()
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using HotChocolate.Language;

namespace HotChocolate.Adapters.OpenApi;

public interface IOpenApiDocument
{
string Id { get; }

string Name { get; }

string? Description { get; }

Dictionary<string, FragmentDefinitionNode> LocalFragmentLookup { get; }

HashSet<string> ExternalFragmentReferences { get; }
}
Loading
Loading