diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 83330bdf54..c11b8f2803 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -56,3 +56,17 @@ jobs:
config: '.markdownlint.json'
globs: |
**/*.md
+
+ - name: Setup Node
+ uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
+ with:
+ node-version: '24.x'
+
+ - name: Install Spectral
+ run: npm install --global "@stoplight/spectral-cli@${SPECTRAL_VERSION}"
+ env:
+ # renovate: datasource=npm packageName=@stoplight/spectral-cli
+ SPECTRAL_VERSION: '6.15.0'
+
+ - name: Run Spectral
+ run: spectral lint "./test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/*" --display-only-failures --fail-severity error --format github-actions
diff --git a/.spectral.yaml b/.spectral.yaml
new file mode 100644
index 0000000000..7d9855d6a6
--- /dev/null
+++ b/.spectral.yaml
@@ -0,0 +1 @@
+extends: ['spectral:oas']
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 499bc1f00a..1b60a12dfd 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -15,6 +15,7 @@
+
@@ -22,6 +23,7 @@
+
diff --git a/Swashbuckle.AspNetCore.slnx b/Swashbuckle.AspNetCore.slnx
index 4e75d24a73..5ba846053c 100644
--- a/Swashbuckle.AspNetCore.slnx
+++ b/Swashbuckle.AspNetCore.slnx
@@ -77,6 +77,7 @@
+
diff --git a/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SchemaGenerator.cs b/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SchemaGenerator.cs
index f76d8cfd9a..acc20e3d70 100644
--- a/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SchemaGenerator.cs
+++ b/src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SchemaGenerator.cs
@@ -66,22 +66,10 @@ private IOpenApiSchema GenerateSchemaForMember(
{
var requiredAttribute = customAttributes.OfType().FirstOrDefault();
- var nullable = IsNullable(requiredAttribute, dataProperty, memberInfo);
-
- if (usingAllOf)
- {
- // When using AllOf to extend reference schemas, we need to adjust the schema to represent
- // nullability correctly as a property can't be null AND a specific type at the same time.
- // See https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/3649.
- if (nullable)
- {
- concrete.OneOf = schema.AllOf;
- concrete.OneOf.Add(new OpenApiSchema { Type = JsonSchemaType.Null });
- concrete.AllOf = null;
- }
- }
- else
+ // "nullable" cannot be used without "type"
+ if (!usingAllOf)
{
+ var nullable = IsNullable(requiredAttribute, dataProperty, memberInfo);
SetNullable(concrete, nullable);
}
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/ClientGenerator.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/ClientGenerator.cs
index 6748caf788..2bc79a1f29 100644
--- a/test/Swashbuckle.AspNetCore.IntegrationTests/ClientGenerator.cs
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/ClientGenerator.cs
@@ -73,22 +73,30 @@ public async Task CompileAsync(string location)
public async Task GenerateFromStringAsync(ClientGeneratorTool generator, string openApiDocument)
{
- TemporaryDirectory project;
+ TemporaryDirectory project = null;
- switch (generator)
+ try
+ {
+ switch (generator)
+ {
+ case ClientGeneratorTool.Kiota:
+ project = await GenerateProjectAsync(["Microsoft.Kiota.Bundle"]);
+ await GenerateClientFromStringWithKiotaAsync(project.Path, openApiDocument, outputHelper);
+ break;
+
+ case ClientGeneratorTool.NSwag:
+ project = await GenerateProjectAsync(["Newtonsoft.Json"]);
+ await GenerateClientFromStringWithNSwagAsync(project.Path, openApiDocument);
+ break;
+
+ default:
+ throw new ArgumentOutOfRangeException(nameof(generator), generator, $"The client generator tool '{generator}' is not supported.");
+ }
+ }
+ catch (Exception)
{
- case ClientGeneratorTool.Kiota:
- project = await GenerateProjectAsync(["Microsoft.Kiota.Bundle"]);
- await GenerateClientFromStringWithKiotaAsync(project.Path, openApiDocument, outputHelper);
- break;
-
- case ClientGeneratorTool.NSwag:
- project = await GenerateProjectAsync(["Newtonsoft.Json"]);
- await GenerateClientFromStringWithNSwagAsync(project.Path, openApiDocument);
- break;
-
- default:
- throw new ArgumentOutOfRangeException(nameof(generator), generator, $"The client generator tool '{generator}' is not supported.");
+ project?.Dispose();
+ throw;
}
return project;
@@ -96,22 +104,30 @@ public async Task GenerateFromStringAsync(ClientGeneratorToo
public async Task GenerateFromUrlAsync(ClientGeneratorTool generator, string openApiDocumentUrl)
{
- TemporaryDirectory project;
+ TemporaryDirectory project = null;
- switch (generator)
+ try
+ {
+ switch (generator)
+ {
+ case ClientGeneratorTool.Kiota:
+ project = await GenerateProjectAsync(["Microsoft.Kiota.Bundle"]);
+ await GenerateClientFromUrlWithKiotaAsync(project.Path, openApiDocumentUrl, outputHelper);
+ break;
+
+ case ClientGeneratorTool.NSwag:
+ project = await GenerateProjectAsync(["Newtonsoft.Json"]);
+ await GenerateClientFromUrlWithNSwagAsync(project.Path, openApiDocumentUrl);
+ break;
+
+ default:
+ throw new ArgumentOutOfRangeException(nameof(generator), generator, $"The client generator tool '{generator}' is not supported.");
+ }
+ }
+ catch (Exception)
{
- case ClientGeneratorTool.Kiota:
- project = await GenerateProjectAsync(["Microsoft.Kiota.Bundle"]);
- await GenerateClientFromUrlWithKiotaAsync(project.Path, openApiDocumentUrl, outputHelper);
- break;
-
- case ClientGeneratorTool.NSwag:
- project = await GenerateProjectAsync(["Newtonsoft.Json"]);
- await GenerateClientFromUrlWithNSwagAsync(project.Path, openApiDocumentUrl);
- break;
-
- default:
- throw new ArgumentOutOfRangeException(nameof(generator), generator, $"The client generator tool '{generator}' is not supported.");
+ project?.Dispose();
+ throw;
}
return project;
@@ -283,7 +299,7 @@ private static string GetNuGetPackageVersion(string name)
var ns = project.Root.GetDefaultNamespace();
var version = project
- .Root?
+ .Root
.Elements(ns + "ItemGroup")
.Elements(ns + "PackageVersion")
.Select((p) =>
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/CodeGenerationTests.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/CodeGenerationTests.cs
index d79992ee1a..1c556d9279 100644
--- a/test/Swashbuckle.AspNetCore.IntegrationTests/CodeGenerationTests.cs
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/CodeGenerationTests.cs
@@ -1,8 +1,14 @@
#if NET10_0_OR_GREATER
using System.Reflection;
-using System.Text.Json;
+using System.Security.Cryptography;
+using System.Text;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Kiota.Abstractions.Authentication;
+using Microsoft.Kiota.Http.HttpClientLibrary;
using Microsoft.OpenApi;
+using TodoApp.Client;
+using TodoApp.Client.Models;
namespace Swashbuckle.AspNetCore.IntegrationTests;
@@ -15,28 +21,17 @@ public static TheoryData SnapshotTestCases()
{
var testCases = new TheoryData();
- foreach (var path in Directory.EnumerateFiles(Path.Combine(GetProjectRoot(), "snapshots"), "*.txt", SearchOption.AllDirectories))
+ foreach (var testCase in SnapshotTestData.Snapshots())
{
+ var path = testCase.Data.Item1;
+ var documentVersion = testCase.Data.Item2;
+
// Deduplicate by ignoring snapshots for other TFMs
if (!path.EndsWith(".DotNet10_0.verified.txt", StringComparison.Ordinal))
{
continue;
}
- using var snapshot = File.OpenRead(path);
- using var document = JsonDocument.Parse(snapshot);
-
- if (!document.RootElement.TryGetProperty("openapi", out var property) &&
- !document.RootElement.TryGetProperty("swagger", out property))
- {
- continue;
- }
-
- if (!Version.TryParse(property.GetString(), out var documentVersion))
- {
- continue;
- }
-
var version = documentVersion switch
{
{ Major: 2 } => OpenApiSpecVersion.OpenApi2_0,
@@ -65,16 +60,284 @@ public static TheoryData SnapshotTestCases()
[Theory]
[MemberData(nameof(SnapshotTestCases))]
- public async Task OpenApiDocument_Generates_Valid_Client_Code_From_Snapshot(ClientGeneratorTool tool, string path)
+ public async Task GeneratesValidClient(ClientGeneratorTool tool, string snapshot)
{
// Arrange
var generator = new ClientGenerator(outputHelper);
- var document = await File.ReadAllTextAsync(path, TestContext.Current.CancellationToken);
+ var snapshotPath = Path.Combine(SnapshotTestData.SnapshotsPath(), snapshot);
+
+ var document = await File.ReadAllTextAsync(snapshotPath, TestContext.Current.CancellationToken);
using var project = await generator.GenerateFromStringAsync(tool, document);
// Act and Assert
await generator.CompileAsync(project.Path);
+
+ var hash = SHA256.HashData(Encoding.UTF8.GetBytes($"{tool}:{snapshot}"));
+ var hashString = Convert.ToHexString(hash).ToLowerInvariant()[..16];
+
+ outputHelper.WriteLine($"{nameof(tool)}={tool}, {nameof(snapshot)}={snapshot} [{hashString}]");
+
+ await VerifyDirectory(
+ project.Path,
+ pattern: "*.cs",
+ include: (p) => !p.Contains("bin") && !p.Contains("obj"),
+ options: new() { RecurseSubdirectories = true })
+ .UseDirectory("snapshots")
+ .UseFileName($"{nameof(GeneratesValidClient)}_{hashString}");
+ }
+
+ [Fact]
+ public async Task Can_Manage_Todo_Items_With_Api()
+ {
+ // Arrange
+ await WithTodoAppClientAsync(async (client) =>
+ {
+ var cancellationToken = TestContext.Current.CancellationToken;
+
+ // Act - Get all the items
+ var items = await client.Api.Items.GetAsync(cancellationToken: cancellationToken);
+
+ // Assert - There should be no items
+ Assert.NotNull(items);
+ Assert.NotNull(items.Items);
+
+ var beforeCount = items.Items.Count;
+
+ // Arrange
+ var text = "Buy eggs";
+
+ // Act - Add a new item
+ var createdItem = await client.Api.Items.PostAsync(
+ new() { Text = text },
+ cancellationToken: cancellationToken);
+
+ // Assert - An item was created
+ Assert.NotNull(createdItem);
+ Assert.NotEqual(default, createdItem.Id);
+
+ // Arrange - Get the new item's URL and Id
+ var itemId = createdItem.Id;
+
+ // Act - Get the item
+ var item = await client.Api.Items[new(itemId)].GetAsync(cancellationToken: cancellationToken);
+
+ // Assert - Verify the item was created correctly
+ Assert.NotNull(item);
+ Assert.Equal(itemId, item.Id);
+ Assert.Null(item.CompletedAt);
+ Assert.NotEqual(default, item.CreatedAt);
+ Assert.Equal(item.CreatedAt.Value, item.LastUpdated);
+ Assert.Null(item.Priority);
+ Assert.Equal(text, item.Text);
+
+ // Act - Update the item to be high priority
+ await client.Api.Items[new(itemId)].Priority.PatchAsync(
+ new() { Priority = TodoPriority.High },
+ cancellationToken: cancellationToken);
+
+ item = await client.Api.Items[new(itemId)].GetAsync(cancellationToken: cancellationToken);
+
+ Assert.NotNull(item);
+ Assert.Equal(itemId, item.Id);
+ Assert.Null(item.CompletedAt);
+ Assert.NotEqual(default, item.CreatedAt);
+ Assert.Equal(item.CreatedAt.Value, item.LastUpdated);
+ Assert.Equal(TodoPriority.High, item.Priority);
+ Assert.Equal(text, item.Text);
+
+ // Act - Mark the item as being completed
+ await client.Api.Items[new(itemId)].Complete.PostAsync(cancellationToken: cancellationToken);
+
+ item = await client.Api.Items[new(itemId)].GetAsync(cancellationToken: cancellationToken);
+
+ Assert.NotNull(item);
+ Assert.Equal(itemId, item.Id);
+ Assert.Equal(text, item.Text);
+ Assert.NotNull(item.CompletedAt);
+ Assert.Equal(item.CompletedAt.Value, item.LastUpdated);
+ Assert.True(item.CompletedAt.Value > item.CreatedAt);
+
+ // Act - Get all the items
+ items = await client.Api.Items.GetAsync(cancellationToken: cancellationToken);
+
+ // Assert - The item was completed
+ Assert.NotNull(items);
+ Assert.NotNull(items.Items);
+ Assert.Equal(beforeCount + 1, items.Items.Count);
+ Assert.Contains(items.Items, (x) => x.Id == itemId);
+
+ item = items.Items.Last();
+
+ Assert.NotNull(item);
+ Assert.Equal(itemId, item.Id);
+ Assert.Equal(text, item.Text);
+ Assert.NotNull(item.CompletedAt);
+ Assert.Equal(item.CompletedAt.Value, item.LastUpdated);
+ Assert.True(item.CompletedAt.Value > item.CreatedAt);
+
+ // Act - Delete the item
+ await client.Api.Items[new(itemId)].DeleteAsync(cancellationToken: cancellationToken);
+
+ // Assert - The item no longer exists
+ items = await client.Api.Items.GetAsync(cancellationToken: cancellationToken);
+
+ Assert.NotNull(items);
+ Assert.NotNull(items.Items);
+ Assert.Equal(beforeCount, items.Items.Count);
+ Assert.DoesNotContain(items.Items, (x) => x.Id == itemId);
+
+ // Act
+ var problem = await Assert.ThrowsAsync(
+ () => client.Api.Items[new(itemId)].GetAsync(cancellationToken: cancellationToken));
+
+ // Assert
+ Assert.NotNull(problem);
+ Assert.Equal(StatusCodes.Status404NotFound, problem.Status);
+ Assert.Equal("Not Found", problem.Title);
+ Assert.Equal("Item not found.", problem.Detail);
+ Assert.Equal("https://tools.ietf.org/html/rfc9110#section-15.5.5", problem.Type);
+ Assert.Null(problem.Instance);
+
+ // Act
+ problem = await Assert.ThrowsAsync(
+ () => client.Api.Items[new(itemId)].Complete.PostAsync(cancellationToken: cancellationToken));
+
+ // Assert
+ Assert.NotNull(problem);
+ Assert.Equal(StatusCodes.Status404NotFound, problem.Status);
+ Assert.Equal("Not Found", problem.Title);
+ Assert.Equal("Item not found.", problem.Detail);
+ Assert.Equal("https://tools.ietf.org/html/rfc9110#section-15.5.5", problem.Type);
+ Assert.Null(problem.Instance);
+
+ // Act
+ problem = await Assert.ThrowsAsync(
+ () => client.Api.Items[new(itemId)].Priority.PatchAsync(new() { Priority = TodoPriority.Low }, cancellationToken: cancellationToken));
+
+ // Assert
+ Assert.NotNull(problem);
+ Assert.Equal(StatusCodes.Status404NotFound, problem.Status);
+ Assert.Equal("Not Found", problem.Title);
+ Assert.Equal("Item not found.", problem.Detail);
+ Assert.Equal("https://tools.ietf.org/html/rfc9110#section-15.5.5", problem.Type);
+ Assert.Null(problem.Instance);
+ });
+ }
+
+ [Fact]
+ public async Task Cannot_Create_Todo_Item_With_No_Text()
+ {
+ // Arrange
+ await WithTodoAppClientAsync(async (client) =>
+ {
+ var cancellationToken = TestContext.Current.CancellationToken;
+
+ // Act
+ var problem = await Assert.ThrowsAsync(
+ () => client.Api.Items.PostAsync(new() { Text = string.Empty }, cancellationToken: cancellationToken));
+
+ // Assert
+ Assert.NotNull(problem);
+ Assert.Equal(StatusCodes.Status400BadRequest, problem.Status);
+ Assert.Equal("Bad Request", problem.Title);
+ Assert.Equal("No item text specified.", problem.Detail);
+ Assert.Equal("https://tools.ietf.org/html/rfc9110#section-15.5.1", problem.Type);
+ Assert.Null(problem.Instance);
+ });
+ }
+
+ [Fact]
+ public async Task Cannot_Complete_Todo_Item_Multiple_Times()
+ {
+ // Arrange
+ await WithTodoAppClientAsync(async (client) =>
+ {
+ var cancellationToken = TestContext.Current.CancellationToken;
+
+ var createdItem = await client.Api.Items.PostAsync(
+ new() { Text = "Something" },
+ cancellationToken: cancellationToken);
+
+ await client.Api.Items[new(createdItem.Id)].Complete.PostAsync(cancellationToken: cancellationToken);
+
+ // Act
+ var problem = await Assert.ThrowsAsync(
+ () => client.Api.Items[new(createdItem.Id)].Complete.PostAsync(cancellationToken: cancellationToken));
+
+ // Assert
+ Assert.NotNull(problem);
+ Assert.Equal(StatusCodes.Status400BadRequest, problem.Status);
+ Assert.Equal("Bad Request", problem.Title);
+ Assert.Equal("Item already completed.", problem.Detail);
+ Assert.Equal("https://tools.ietf.org/html/rfc9110#section-15.5.1", problem.Type);
+ Assert.Null(problem.Instance);
+ });
+ }
+
+ [Fact]
+ public async Task Cannot_Complete_Deleted_Todo_Item()
+ {
+ // Arrange
+ await WithTodoAppClientAsync(async (client) =>
+ {
+ var cancellationToken = TestContext.Current.CancellationToken;
+
+ var createdItem = await client.Api.Items.PostAsync(
+ new() { Text = "Something" },
+ cancellationToken: cancellationToken);
+
+ await client.Api.Items[new(createdItem.Id)].DeleteAsync(cancellationToken: cancellationToken);
+
+ // Act
+ var problem = await Assert.ThrowsAsync(
+ () => client.Api.Items[new(createdItem.Id)].Complete.PostAsync(cancellationToken: cancellationToken));
+
+ // Assert
+ Assert.NotNull(problem);
+ Assert.Equal(StatusCodes.Status404NotFound, problem.Status);
+ Assert.Equal("Not Found", problem.Title);
+ Assert.Equal("Item not found.", problem.Detail);
+ Assert.Equal("https://tools.ietf.org/html/rfc9110#section-15.5.5", problem.Type);
+ Assert.Null(problem.Instance);
+ });
+ }
+
+ [Fact]
+ public async Task Cannot_Delete_Todo_Item_Multiple_Times()
+ {
+ // Arrange
+ await WithTodoAppClientAsync(async (client) =>
+ {
+ var cancellationToken = TestContext.Current.CancellationToken;
+
+ var createdItem = await client.Api.Items.PostAsync(
+ new() { Text = "Something" },
+ cancellationToken: cancellationToken);
+
+ await client.Api.Items[new(createdItem.Id)].DeleteAsync(cancellationToken: cancellationToken);
+
+ // Act
+ var problem = await Assert.ThrowsAsync(
+ () => client.Api.Items[new(createdItem.Id)].DeleteAsync(cancellationToken: cancellationToken));
+
+ // Assert
+ Assert.NotNull(problem);
+ Assert.Equal(StatusCodes.Status404NotFound, problem.Status);
+ Assert.Equal("Not Found", problem.Title);
+ Assert.Equal("Item not found.", problem.Detail);
+ Assert.Equal("https://tools.ietf.org/html/rfc9110#section-15.5.5", problem.Type);
+ Assert.Null(problem.Instance);
+ });
+ }
+
+ [Fact]
+ public async Task VerifyKiotaTodoAppClient()
+ {
+ await VerifyDirectory(
+ Path.Combine(GetProjectRoot(), "TodoClient"),
+ pattern: "*.cs",
+ options: new() { RecurseSubdirectories = true }).UseDirectory("snapshots");
}
private static string GetProjectRoot() =>
@@ -82,6 +345,18 @@ private static string GetProjectRoot() =>
.GetCustomAttributes()
.First((p) => p.Key is "ProjectRoot")
.Value!;
+
+ private static async Task WithTodoAppClientAsync(Func callback)
+ {
+ using var httpClient = SwaggerIntegrationTests.GetHttpClientForTestApplication(typeof(TodoApp.Program));
+
+ var provider = new AnonymousAuthenticationProvider();
+ using var request = new HttpClientRequestAdapter(provider, httpClient: httpClient);
+
+ var client = new TodoApiClient(request);
+
+ await callback(client);
+ }
}
#endif
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/SchemaTests.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/SchemaTests.cs
new file mode 100644
index 0000000000..38f9a8b083
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/SchemaTests.cs
@@ -0,0 +1,27 @@
+using NJsonSchema;
+
+namespace Swashbuckle.AspNetCore.IntegrationTests;
+
+public class SchemaTests
+{
+ [Theory]
+ [MemberData(nameof(SnapshotTestData.Snapshots), MemberType = typeof(SnapshotTestData))]
+ public async Task OpenApiDocumentsAreValid(string snapshot, Version version)
+ {
+ // Arrange
+ var cancellationToken = TestContext.Current.CancellationToken;
+
+ var schemaPath = Path.Combine(SnapshotTestData.SchemasPath(), $"schema.{version.Major}.{version.Minor}.json");
+ var snapshotPath = Path.Combine(SnapshotTestData.SnapshotsPath(), snapshot);
+
+ var schema = await JsonSchema.FromFileAsync(schemaPath, cancellationToken);
+ var specification = await File.ReadAllTextAsync(snapshotPath, cancellationToken);
+
+ // Act
+ var actual = schema.Validate(specification);
+
+ // Assert
+ Assert.NotNull(actual);
+ Assert.Empty(actual);
+ }
+}
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/SnapshotTestData.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/SnapshotTestData.cs
new file mode 100644
index 0000000000..d4dc311a0a
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/SnapshotTestData.cs
@@ -0,0 +1,46 @@
+using System.Reflection;
+using System.Text.Json;
+
+namespace Swashbuckle.AspNetCore.IntegrationTests;
+
+public static class SnapshotTestData
+{
+ private static string _projectRoot =
+ typeof(SnapshotTestData).Assembly
+ .GetCustomAttributes()
+ .First((p) => p.Key is "ProjectRoot")
+ .Value!;
+
+ public static string SnapshotsPath() => Path.Combine(_projectRoot, "snapshots");
+
+ public static string SchemasPath() => Path.Combine(_projectRoot, "schemas");
+
+ public static TheoryData Snapshots()
+ {
+ var testCases = new TheoryData();
+ var snapshotsPath = Path.Combine(_projectRoot, "snapshots");
+
+ foreach (var path in Directory.EnumerateFiles(snapshotsPath, "*.txt", SearchOption.AllDirectories))
+ {
+ using var snapshot = File.OpenRead(path);
+ using var document = JsonDocument.Parse(snapshot);
+
+ if (!document.RootElement.TryGetProperty("openapi", out var property) &&
+ !document.RootElement.TryGetProperty("swagger", out property))
+ {
+ continue;
+ }
+
+ if (!Version.TryParse(property.GetString(), out var version))
+ {
+ continue;
+ }
+
+ var relativePath = Path.GetRelativePath(snapshotsPath, path);
+
+ testCases.Add(relativePath, version);
+ }
+
+ return testCases;
+ }
+}
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/SwaggerIntegrationTests.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/SwaggerIntegrationTests.cs
index d992e8261e..bba415e2ef 100644
--- a/test/Swashbuckle.AspNetCore.IntegrationTests/SwaggerIntegrationTests.cs
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/SwaggerIntegrationTests.cs
@@ -117,6 +117,7 @@ public async Task SwaggerMiddleware_CanBeConfiguredMultipleTimes(
[InlineData(typeof(MinimalApp.Program), "/swagger/v1/swagger.json")]
[InlineData(typeof(MinimalAppWithNullableEnums.Program), "/swagger/v1/swagger.json")]
[InlineData(typeof(MvcWithNullable.Program), "/swagger/v1/swagger.json")]
+ [InlineData(typeof(TodoApp.Program), "/swagger/v1/swagger.json")]
[InlineData(typeof(TopLevelSwaggerDoc.Program), "/swagger/v1.json")]
[InlineData(typeof(WebApi.Program), "/swagger/v1/swagger.json")]
[InlineData(typeof(WebApi.Aot.Program), "/swagger/v1/swagger.json")]
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/Swashbuckle.AspNetCore.IntegrationTests.csproj b/test/Swashbuckle.AspNetCore.IntegrationTests/Swashbuckle.AspNetCore.IntegrationTests.csproj
index a963d5d5eb..c77f8cbb1a 100644
--- a/test/Swashbuckle.AspNetCore.IntegrationTests/Swashbuckle.AspNetCore.IntegrationTests.csproj
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/Swashbuckle.AspNetCore.IntegrationTests.csproj
@@ -17,21 +17,27 @@
+
+
-
+
-
+
+
+
+
+
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/ApiRequestBuilder.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/ApiRequestBuilder.cs
new file mode 100644
index 0000000000..41b43725aa
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/ApiRequestBuilder.cs
@@ -0,0 +1,41 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System;
+using TodoApp.Client.Api.Items;
+namespace TodoApp.Client.Api
+{
+ ///
+ /// Builds and executes requests for operations under \api
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class ApiRequestBuilder : BaseRequestBuilder
+ {
+ /// The items property
+ public global::TodoApp.Client.Api.Items.ItemsRequestBuilder Items
+ {
+ get => new global::TodoApp.Client.Api.Items.ItemsRequestBuilder(PathParameters, RequestAdapter);
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public ApiRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public ApiRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api", rawUrl)
+ {
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/Find/FindRequestBuilder.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/Find/FindRequestBuilder.cs
new file mode 100644
index 0000000000..88a9b963c9
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/Find/FindRequestBuilder.cs
@@ -0,0 +1,94 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+using TodoApp.Client.Models;
+namespace TodoApp.Client.Api.Items.Find
+{
+ ///
+ /// Builds and executes requests for operations under \api\items\find
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class FindRequestBuilder : BaseRequestBuilder
+ {
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public FindRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/find?IsCompleted={IsCompleted}&Text={Text}", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public FindRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/find?IsCompleted={IsCompleted}&Text={Text}", rawUrl)
+ {
+ }
+ /// A
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ var requestInfo = ToGetRequestInformation(requestConfiguration);
+ return await RequestAdapter.SendAsync(requestInfo, global::TodoApp.Client.Models.TodoListViewModel.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false);
+ }
+ /// A
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default)
+ {
+#endif
+ var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/json");
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::TodoApp.Client.Api.Items.Find.FindRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::TodoApp.Client.Api.Items.Find.FindRequestBuilder(rawUrl, RequestAdapter);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ #pragma warning disable CS1591
+ public partial class FindRequestBuilderGetQueryParameters
+ #pragma warning restore CS1591
+ {
+ /// Gets or sets a value indicating whether to search completed Todo items.
+ public bool? IsCompleted { get; set; }
+ /// Gets or sets the text of the filter.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Text { get; set; }
+#nullable restore
+#else
+ public string Text { get; set; }
+#endif
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/GetAfter/GetAfterRequestBuilder.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/GetAfter/GetAfterRequestBuilder.cs
new file mode 100644
index 0000000000..08a2cd13ad
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/GetAfter/GetAfterRequestBuilder.cs
@@ -0,0 +1,86 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+using TodoApp.Client.Models;
+namespace TodoApp.Client.Api.Items.GetAfter
+{
+ ///
+ /// Builds and executes requests for operations under \api\items\getAfter
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class GetAfterRequestBuilder : BaseRequestBuilder
+ {
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public GetAfterRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/getAfter?value={value}", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public GetAfterRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/getAfter?value={value}", rawUrl)
+ {
+ }
+ /// A
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ var requestInfo = ToGetRequestInformation(requestConfiguration);
+ return await RequestAdapter.SendAsync(requestInfo, global::TodoApp.Client.Models.TodoListViewModel.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false);
+ }
+ /// A
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default)
+ {
+#endif
+ var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/json");
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::TodoApp.Client.Api.Items.GetAfter.GetAfterRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::TodoApp.Client.Api.Items.GetAfter.GetAfterRequestBuilder(rawUrl, RequestAdapter);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ #pragma warning disable CS1591
+ public partial class GetAfterRequestBuilderGetQueryParameters
+ #pragma warning restore CS1591
+ {
+ [QueryParameter("value")]
+ public DateTimeOffset? Value { get; set; }
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/Item/Complete/CompleteRequestBuilder.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/Item/Complete/CompleteRequestBuilder.cs
new file mode 100644
index 0000000000..d60b464e51
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/Item/Complete/CompleteRequestBuilder.cs
@@ -0,0 +1,90 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+using TodoApp.Client.Models;
+namespace TodoApp.Client.Api.Items.Item.Complete
+{
+ ///
+ /// Builds and executes requests for operations under \api\items\{id}\complete
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class CompleteRequestBuilder : BaseRequestBuilder
+ {
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public CompleteRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/{id}/complete", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public CompleteRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/{id}/complete", rawUrl)
+ {
+ }
+ ///
+ /// Marks the todo item with the specified ID as complete.
+ ///
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ /// When receiving a 400 status code
+ /// When receiving a 404 status code
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ var requestInfo = ToPostRequestInformation(requestConfiguration);
+ var errorMapping = new Dictionary>
+ {
+ { "400", global::TodoApp.Client.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ { "404", global::TodoApp.Client.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ };
+ await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
+ }
+ ///
+ /// Marks the todo item with the specified ID as complete.
+ ///
+ /// A
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default)
+ {
+#endif
+ var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/problem+json");
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::TodoApp.Client.Api.Items.Item.Complete.CompleteRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::TodoApp.Client.Api.Items.Item.Complete.CompleteRequestBuilder(rawUrl, RequestAdapter);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/Item/ItemsItemRequestBuilder.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/Item/ItemsItemRequestBuilder.cs
new file mode 100644
index 0000000000..7a7d75d5df
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/Item/ItemsItemRequestBuilder.cs
@@ -0,0 +1,142 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+using TodoApp.Client.Api.Items.Item.Complete;
+using TodoApp.Client.Api.Items.Item.Priority;
+using TodoApp.Client.Models;
+namespace TodoApp.Client.Api.Items.Item
+{
+ ///
+ /// Builds and executes requests for operations under \api\items\{id}
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class ItemsItemRequestBuilder : BaseRequestBuilder
+ {
+ /// The complete property
+ public global::TodoApp.Client.Api.Items.Item.Complete.CompleteRequestBuilder Complete
+ {
+ get => new global::TodoApp.Client.Api.Items.Item.Complete.CompleteRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// The priority property
+ public global::TodoApp.Client.Api.Items.Item.Priority.PriorityRequestBuilder Priority
+ {
+ get => new global::TodoApp.Client.Api.Items.Item.Priority.PriorityRequestBuilder(PathParameters, RequestAdapter);
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public ItemsItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/{id}", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public ItemsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/{id}", rawUrl)
+ {
+ }
+ ///
+ /// Deletes the todo item with the specified ID.
+ ///
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ /// When receiving a 404 status code
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ var requestInfo = ToDeleteRequestInformation(requestConfiguration);
+ var errorMapping = new Dictionary>
+ {
+ { "404", global::TodoApp.Client.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ };
+ await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
+ }
+ ///
+ /// Gets the todo item with the specified ID.
+ ///
+ /// A
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ /// When receiving a 404 status code
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ var requestInfo = ToGetRequestInformation(requestConfiguration);
+ var errorMapping = new Dictionary>
+ {
+ { "404", global::TodoApp.Client.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ };
+ return await RequestAdapter.SendAsync(requestInfo, global::TodoApp.Client.Models.TodoItemModel.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
+ }
+ ///
+ /// Deletes the todo item with the specified ID.
+ ///
+ /// A
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default)
+ {
+#endif
+ var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/problem+json");
+ return requestInfo;
+ }
+ ///
+ /// Gets the todo item with the specified ID.
+ ///
+ /// A
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default)
+ {
+#endif
+ var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/json");
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::TodoApp.Client.Api.Items.Item.ItemsItemRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::TodoApp.Client.Api.Items.Item.ItemsItemRequestBuilder(rawUrl, RequestAdapter);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/Item/Priority/PriorityRequestBuilder.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/Item/Priority/PriorityRequestBuilder.cs
new file mode 100644
index 0000000000..52e95a1cb8
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/Item/Priority/PriorityRequestBuilder.cs
@@ -0,0 +1,95 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+using TodoApp.Client.Models;
+namespace TodoApp.Client.Api.Items.Item.Priority
+{
+ ///
+ /// Builds and executes requests for operations under \api\items\{id}\priority
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class PriorityRequestBuilder : BaseRequestBuilder
+ {
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public PriorityRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/{id}/priority", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public PriorityRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/{id}/priority", rawUrl)
+ {
+ }
+ ///
+ /// Updates the priority of the todo item with the specified ID to the specified priority.
+ ///
+ /// Represents the model for updating the priority of a Todo item.
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ /// When receiving a 400 status code
+ /// When receiving a 404 status code
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PatchAsync(global::TodoApp.Client.Models.UpdateTodoItemPriorityModel body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task PatchAsync(global::TodoApp.Client.Models.UpdateTodoItemPriorityModel body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
+ var requestInfo = ToPatchRequestInformation(body, requestConfiguration);
+ var errorMapping = new Dictionary>
+ {
+ { "400", global::TodoApp.Client.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ { "404", global::TodoApp.Client.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ };
+ await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
+ }
+ ///
+ /// Updates the priority of the todo item with the specified ID to the specified priority.
+ ///
+ /// A
+ /// Represents the model for updating the priority of a Todo item.
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPatchRequestInformation(global::TodoApp.Client.Models.UpdateTodoItemPriorityModel body, Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToPatchRequestInformation(global::TodoApp.Client.Models.UpdateTodoItemPriorityModel body, Action> requestConfiguration = default)
+ {
+#endif
+ if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
+ var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/problem+json");
+ requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::TodoApp.Client.Api.Items.Item.Priority.PriorityRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::TodoApp.Client.Api.Items.Item.Priority.PriorityRequestBuilder(rawUrl, RequestAdapter);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/ItemsRequestBuilder.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/ItemsRequestBuilder.cs
new file mode 100644
index 0000000000..489335512c
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Api/Items/ItemsRequestBuilder.cs
@@ -0,0 +1,156 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+using TodoApp.Client.Api.Items.Find;
+using TodoApp.Client.Api.Items.GetAfter;
+using TodoApp.Client.Api.Items.Item;
+using TodoApp.Client.Models;
+namespace TodoApp.Client.Api.Items
+{
+ ///
+ /// Builds and executes requests for operations under \api\items
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class ItemsRequestBuilder : BaseRequestBuilder
+ {
+ /// The find property
+ public global::TodoApp.Client.Api.Items.Find.FindRequestBuilder Find
+ {
+ get => new global::TodoApp.Client.Api.Items.Find.FindRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// The getAfter property
+ public global::TodoApp.Client.Api.Items.GetAfter.GetAfterRequestBuilder GetAfter
+ {
+ get => new global::TodoApp.Client.Api.Items.GetAfter.GetAfterRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// Gets an item from the TodoApp.Client.api.items.item collection
+ /// The Todo item's ID.
+ /// A
+ public global::TodoApp.Client.Api.Items.Item.ItemsItemRequestBuilder this[Guid position]
+ {
+ get
+ {
+ var urlTplParams = new Dictionary(PathParameters);
+ urlTplParams.Add("id", position);
+ return new global::TodoApp.Client.Api.Items.Item.ItemsItemRequestBuilder(urlTplParams, RequestAdapter);
+ }
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public ItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public ItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items", rawUrl)
+ {
+ }
+ ///
+ /// Gets all of the current user's todo items.
+ ///
+ /// A
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ var requestInfo = ToGetRequestInformation(requestConfiguration);
+ return await RequestAdapter.SendAsync(requestInfo, global::TodoApp.Client.Models.TodoListViewModel.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false);
+ }
+ ///
+ /// Creates a new todo item for the current user and returns its ID.
+ ///
+ /// A
+ /// Represents the model for creating a new Todo item.
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ /// When receiving a 400 status code
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PostAsync(global::TodoApp.Client.Models.CreateTodoItemModel body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task PostAsync(global::TodoApp.Client.Models.CreateTodoItemModel body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
+ var requestInfo = ToPostRequestInformation(body, requestConfiguration);
+ var errorMapping = new Dictionary>
+ {
+ { "400", global::TodoApp.Client.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ };
+ return await RequestAdapter.SendAsync(requestInfo, global::TodoApp.Client.Models.CreatedTodoItemModel.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
+ }
+ ///
+ /// Gets all of the current user's todo items.
+ ///
+ /// A
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default)
+ {
+#endif
+ var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/json");
+ return requestInfo;
+ }
+ ///
+ /// Creates a new todo item for the current user and returns its ID.
+ ///
+ /// A
+ /// Represents the model for creating a new Todo item.
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPostRequestInformation(global::TodoApp.Client.Models.CreateTodoItemModel body, Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToPostRequestInformation(global::TodoApp.Client.Models.CreateTodoItemModel body, Action> requestConfiguration = default)
+ {
+#endif
+ if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
+ var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/json");
+ requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::TodoApp.Client.Api.Items.ItemsRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::TodoApp.Client.Api.Items.ItemsRequestBuilder(rawUrl, RequestAdapter);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/CreateTodoItemModel.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/CreateTodoItemModel.cs
new file mode 100644
index 0000000000..997121bab3
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/CreateTodoItemModel.cs
@@ -0,0 +1,56 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System.Collections.Generic;
+using System.IO;
+using System;
+namespace TodoApp.Client.Models
+{
+ ///
+ /// Represents the model for creating a new Todo item.
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class CreateTodoItemModel : IParsable
+ {
+ /// Gets or sets the text of the Todo item.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Text { get; set; }
+#nullable restore
+#else
+ public string Text { get; set; }
+#endif
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// A
+ /// The parse node to use to read the discriminator value and create the object
+ public static global::TodoApp.Client.Models.CreateTodoItemModel CreateFromDiscriminatorValue(IParseNode parseNode)
+ {
+ if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
+ return new global::TodoApp.Client.Models.CreateTodoItemModel();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ /// A IDictionary<string, Action<IParseNode>>
+ public virtual IDictionary> GetFieldDeserializers()
+ {
+ return new Dictionary>
+ {
+ { "text", n => { Text = n.GetStringValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public virtual void Serialize(ISerializationWriter writer)
+ {
+ if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
+ writer.WriteStringValue("text", Text);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/CreatedTodoItemModel.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/CreatedTodoItemModel.cs
new file mode 100644
index 0000000000..e3ebeb104f
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/CreatedTodoItemModel.cs
@@ -0,0 +1,56 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System.Collections.Generic;
+using System.IO;
+using System;
+namespace TodoApp.Client.Models
+{
+ ///
+ /// Represents the model for a created Todo item.
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class CreatedTodoItemModel : IParsable
+ {
+ /// Gets or sets the ID of the created Todo item.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Id { get; set; }
+#nullable restore
+#else
+ public string Id { get; set; }
+#endif
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// A
+ /// The parse node to use to read the discriminator value and create the object
+ public static global::TodoApp.Client.Models.CreatedTodoItemModel CreateFromDiscriminatorValue(IParseNode parseNode)
+ {
+ if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
+ return new global::TodoApp.Client.Models.CreatedTodoItemModel();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ /// A IDictionary<string, Action<IParseNode>>
+ public virtual IDictionary> GetFieldDeserializers()
+ {
+ return new Dictionary>
+ {
+ { "id", n => { Id = n.GetStringValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public virtual void Serialize(ISerializationWriter writer)
+ {
+ if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
+ writer.WriteStringValue("id", Id);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/ProblemDetails.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/ProblemDetails.cs
new file mode 100644
index 0000000000..49aa45adb4
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/ProblemDetails.cs
@@ -0,0 +1,92 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System;
+namespace TodoApp.Client.Models
+{
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ #pragma warning disable CS1591
+ public partial class ProblemDetails : ApiException, IParsable
+ #pragma warning restore CS1591
+ {
+ /// The detail property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Detail { get; set; }
+#nullable restore
+#else
+ public string Detail { get; set; }
+#endif
+ /// The instance property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Instance { get; set; }
+#nullable restore
+#else
+ public string Instance { get; set; }
+#endif
+ /// The primary error message.
+ public override string Message { get => base.Message; }
+ /// The status property
+ public int? Status { get; set; }
+ /// The title property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Title { get; set; }
+#nullable restore
+#else
+ public string Title { get; set; }
+#endif
+ /// The type property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Type { get; set; }
+#nullable restore
+#else
+ public string Type { get; set; }
+#endif
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// A
+ /// The parse node to use to read the discriminator value and create the object
+ public static global::TodoApp.Client.Models.ProblemDetails CreateFromDiscriminatorValue(IParseNode parseNode)
+ {
+ if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
+ return new global::TodoApp.Client.Models.ProblemDetails();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ /// A IDictionary<string, Action<IParseNode>>
+ public virtual IDictionary> GetFieldDeserializers()
+ {
+ return new Dictionary>
+ {
+ { "detail", n => { Detail = n.GetStringValue(); } },
+ { "instance", n => { Instance = n.GetStringValue(); } },
+ { "status", n => { Status = n.GetIntValue(); } },
+ { "title", n => { Title = n.GetStringValue(); } },
+ { "type", n => { Type = n.GetStringValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public virtual void Serialize(ISerializationWriter writer)
+ {
+ if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
+ writer.WriteStringValue("detail", Detail);
+ writer.WriteStringValue("instance", Instance);
+ writer.WriteIntValue("status", Status);
+ writer.WriteStringValue("title", Title);
+ writer.WriteStringValue("type", Type);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/TodoItemModel.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/TodoItemModel.cs
new file mode 100644
index 0000000000..10a9a52b98
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/TodoItemModel.cs
@@ -0,0 +1,82 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System.Collections.Generic;
+using System.IO;
+using System;
+namespace TodoApp.Client.Models
+{
+ ///
+ /// Represents a Todo item.
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class TodoItemModel : IParsable
+ {
+ /// Gets or sets the date and time the item was completed.
+ public DateTimeOffset? CompletedAt { get; set; }
+ /// Gets or sets the date and time the item was created.
+ public DateTimeOffset? CreatedAt { get; set; }
+ /// Gets or sets the ID of the Todo item.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Id { get; set; }
+#nullable restore
+#else
+ public string Id { get; set; }
+#endif
+ /// Gets or sets the date and time the Todo item was last updated.
+ public DateTimeOffset? LastUpdated { get; set; }
+ /// Gets or sets the optional priority of the Todo item.
+ public global::TodoApp.Client.Models.TodoPriority? Priority { get; set; }
+ /// Gets or sets the text of the Todo item.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Text { get; set; }
+#nullable restore
+#else
+ public string Text { get; set; }
+#endif
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// A
+ /// The parse node to use to read the discriminator value and create the object
+ public static global::TodoApp.Client.Models.TodoItemModel CreateFromDiscriminatorValue(IParseNode parseNode)
+ {
+ if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
+ return new global::TodoApp.Client.Models.TodoItemModel();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ /// A IDictionary<string, Action<IParseNode>>
+ public virtual IDictionary> GetFieldDeserializers()
+ {
+ return new Dictionary>
+ {
+ { "completedAt", n => { CompletedAt = n.GetDateTimeOffsetValue(); } },
+ { "createdAt", n => { CreatedAt = n.GetDateTimeOffsetValue(); } },
+ { "id", n => { Id = n.GetStringValue(); } },
+ { "lastUpdated", n => { LastUpdated = n.GetDateTimeOffsetValue(); } },
+ { "priority", n => { Priority = n.GetEnumValue(); } },
+ { "text", n => { Text = n.GetStringValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public virtual void Serialize(ISerializationWriter writer)
+ {
+ if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
+ writer.WriteDateTimeOffsetValue("completedAt", CompletedAt);
+ writer.WriteDateTimeOffsetValue("createdAt", CreatedAt);
+ writer.WriteStringValue("id", Id);
+ writer.WriteDateTimeOffsetValue("lastUpdated", LastUpdated);
+ writer.WriteEnumValue("priority", Priority);
+ writer.WriteStringValue("text", Text);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/TodoListViewModel.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/TodoListViewModel.cs
new file mode 100644
index 0000000000..d7fb2e91ac
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/TodoListViewModel.cs
@@ -0,0 +1,56 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System.Collections.Generic;
+using System.IO;
+using System;
+namespace TodoApp.Client.Models
+{
+ ///
+ /// Represents a collection of Todo items.
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class TodoListViewModel : IParsable
+ {
+ /// Gets or sets the Todo item(s).
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public List? Items { get; set; }
+#nullable restore
+#else
+ public List Items { get; set; }
+#endif
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// A
+ /// The parse node to use to read the discriminator value and create the object
+ public static global::TodoApp.Client.Models.TodoListViewModel CreateFromDiscriminatorValue(IParseNode parseNode)
+ {
+ if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
+ return new global::TodoApp.Client.Models.TodoListViewModel();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ /// A IDictionary<string, Action<IParseNode>>
+ public virtual IDictionary> GetFieldDeserializers()
+ {
+ return new Dictionary>
+ {
+ { "items", n => { Items = n.GetCollectionOfObjectValues(global::TodoApp.Client.Models.TodoItemModel.CreateFromDiscriminatorValue)?.AsList(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public virtual void Serialize(ISerializationWriter writer)
+ {
+ if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
+ writer.WriteCollectionOfObjectValues("items", Items);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/TodoPriority.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/TodoPriority.cs
new file mode 100644
index 0000000000..5200deb280
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/TodoPriority.cs
@@ -0,0 +1,23 @@
+//
+using System.Runtime.Serialization;
+using System;
+namespace TodoApp.Client.Models
+{
+ /// The priority levels for a Todo item.
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public enum TodoPriority
+ {
+ [EnumMember(Value = "Normal")]
+ #pragma warning disable CS1591
+ Normal,
+ #pragma warning restore CS1591
+ [EnumMember(Value = "Low")]
+ #pragma warning disable CS1591
+ Low,
+ #pragma warning restore CS1591
+ [EnumMember(Value = "High")]
+ #pragma warning disable CS1591
+ High,
+ #pragma warning restore CS1591
+ }
+}
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/UpdateTodoItemPriorityModel.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/UpdateTodoItemPriorityModel.cs
new file mode 100644
index 0000000000..f2a9c6e583
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/Models/UpdateTodoItemPriorityModel.cs
@@ -0,0 +1,50 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System.Collections.Generic;
+using System.IO;
+using System;
+namespace TodoApp.Client.Models
+{
+ ///
+ /// Represents the model for updating the priority of a Todo item.
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class UpdateTodoItemPriorityModel : IParsable
+ {
+ /// Gets or sets the new priority of the Todo item.
+ public global::TodoApp.Client.Models.TodoPriority? Priority { get; set; }
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// A
+ /// The parse node to use to read the discriminator value and create the object
+ public static global::TodoApp.Client.Models.UpdateTodoItemPriorityModel CreateFromDiscriminatorValue(IParseNode parseNode)
+ {
+ if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
+ return new global::TodoApp.Client.Models.UpdateTodoItemPriorityModel();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ /// A IDictionary<string, Action<IParseNode>>
+ public virtual IDictionary> GetFieldDeserializers()
+ {
+ return new Dictionary>
+ {
+ { "priority", n => { Priority = n.GetEnumValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public virtual void Serialize(ISerializationWriter writer)
+ {
+ if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
+ writer.WriteEnumValue("priority", Priority);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/TodoApiClient.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/TodoApiClient.cs
new file mode 100644
index 0000000000..0d5631bb7d
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/TodoApiClient.cs
@@ -0,0 +1,43 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions;
+using Microsoft.Kiota.Serialization.Form;
+using Microsoft.Kiota.Serialization.Json;
+using Microsoft.Kiota.Serialization.Multipart;
+using Microsoft.Kiota.Serialization.Text;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System;
+using TodoApp.Client.Api;
+namespace TodoApp.Client
+{
+ ///
+ /// The main entry point of the SDK, exposes the configuration and the fluent API.
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class TodoApiClient : BaseRequestBuilder
+ {
+ /// The api property
+ public global::TodoApp.Client.Api.ApiRequestBuilder Api
+ {
+ get => new global::TodoApp.Client.Api.ApiRequestBuilder(PathParameters, RequestAdapter);
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The request adapter to use to execute the requests.
+ public TodoApiClient(IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}", new Dictionary())
+ {
+ ApiClientBuilder.RegisterDefaultSerializer();
+ ApiClientBuilder.RegisterDefaultSerializer();
+ ApiClientBuilder.RegisterDefaultSerializer();
+ ApiClientBuilder.RegisterDefaultSerializer();
+ ApiClientBuilder.RegisterDefaultDeserializer();
+ ApiClientBuilder.RegisterDefaultDeserializer();
+ ApiClientBuilder.RegisterDefaultDeserializer();
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/kiota-lock.json b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/kiota-lock.json
new file mode 100644
index 0000000000..497c46d4b3
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/TodoClient/kiota-lock.json
@@ -0,0 +1,31 @@
+{
+ "descriptionHash": "6220470D2DBDA8D33A3A26AE0D99FD08E8CA025558CE7AF3EFA771BEE7F540049DFB9E14E28367BD30CC488F5A918670E40CF226C0C825CC163EDBFFA1CCE766",
+ "descriptionLocation": "../snapshots/VerifyTests.Swagger_IsValidJson_No_Startup_entryPointType=TodoApp.Program_swaggerRequestUri=v1.DotNet10_0.verified.txt",
+ "lockFileVersion": "1.0.0",
+ "kiotaVersion": "1.29.0",
+ "clientClassName": "TodoApiClient",
+ "typeAccessModifier": "Public",
+ "clientNamespaceName": "TodoApp.Client",
+ "language": "CSharp",
+ "usesBackingStore": false,
+ "excludeBackwardCompatible": true,
+ "includeAdditionalData": false,
+ "disableSSLValidation": false,
+ "serializers": [
+ "Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory",
+ "Microsoft.Kiota.Serialization.Text.TextSerializationWriterFactory",
+ "Microsoft.Kiota.Serialization.Form.FormSerializationWriterFactory",
+ "Microsoft.Kiota.Serialization.Multipart.MultipartSerializationWriterFactory"
+ ],
+ "deserializers": [
+ "Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory",
+ "Microsoft.Kiota.Serialization.Text.TextParseNodeFactory",
+ "Microsoft.Kiota.Serialization.Form.FormParseNodeFactory"
+ ],
+ "structuredMimeTypes": [
+ "application/json"
+ ],
+ "includePatterns": [],
+ "excludePatterns": [],
+ "disabledValidationRules": []
+}
\ No newline at end of file
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/VerifyTests.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/VerifyTests.cs
index 650ea85e31..606400e63c 100644
--- a/test/Swashbuckle.AspNetCore.IntegrationTests/VerifyTests.cs
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/VerifyTests.cs
@@ -58,6 +58,7 @@ await Verify(swagger)
[InlineData(typeof(MinimalApp.Program), "/swagger/v1/swagger.json")]
[InlineData(typeof(MinimalAppWithNullableEnums.Program), "/swagger/v1/swagger.json")]
[InlineData(typeof(MvcWithNullable.Program), "/swagger/v1/swagger.json")]
+ [InlineData(typeof(TodoApp.Program), "/swagger/v1/swagger.json")]
[InlineData(typeof(TopLevelSwaggerDoc.Program), "/swagger/v1.json")]
[InlineData(typeof(WebApi.Program), "/swagger/v1/swagger.json")]
[InlineData(typeof(WebApi.Aot.Program), "/swagger/v1/swagger.json")]
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/generate-todo-client.ps1 b/test/Swashbuckle.AspNetCore.IntegrationTests/generate-todo-client.ps1
new file mode 100644
index 0000000000..2e5ff31862
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/generate-todo-client.ps1
@@ -0,0 +1,28 @@
+#! /usr/bin/env pwsh
+
+param(
+ [Parameter(Mandatory = $false)][string] $OpenApiUrl = "./snapshots/VerifyTests.Swagger_IsValidJson_No_Startup_entryPointType=TodoApp.Program_swaggerRequestUri=v1.DotNet10_0.verified.txt",
+ [Parameter(Mandatory = $false)][switch] $Regenerate
+)
+
+$ErrorActionPreference = "Stop"
+$ProgressPreference = "SilentlyContinue"
+
+$env:KIOTA_TUTORIAL_ENABLED = "false"
+
+$OutputPath = "./TodoClient"
+
+dotnet kiota generate `
+ --additional-data false `
+ --class-name TodoApiClient `
+ --clean-output `
+ --exclude-backward-compatible `
+ --language csharp `
+ --namespace-name TodoApp.Client `
+ --openapi $OpenApiUrl `
+ --output $OutputPath `
+ --structured-mime-types "application/json"
+
+if ($LASTEXITCODE -ne 0) {
+ throw "Kiota generation failed with exit code ${LASTEXITCODE}"
+}
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/schemas/schema.2.0.json b/test/Swashbuckle.AspNetCore.IntegrationTests/schemas/schema.2.0.json
new file mode 100644
index 0000000000..ebe10ed32d
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/schemas/schema.2.0.json
@@ -0,0 +1,1607 @@
+{
+ "title": "A JSON Schema for Swagger 2.0 API.",
+ "id": "http://swagger.io/v2/schema.json#",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "required": [
+ "swagger",
+ "info",
+ "paths"
+ ],
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "swagger": {
+ "type": "string",
+ "enum": [
+ "2.0"
+ ],
+ "description": "The Swagger version of this document."
+ },
+ "info": {
+ "$ref": "#/definitions/info"
+ },
+ "host": {
+ "type": "string",
+ "pattern": "^[^{}/ :\\\\]+(?::\\d+)?$",
+ "description": "The host (name or ip) of the API. Example: 'swagger.io'"
+ },
+ "basePath": {
+ "type": "string",
+ "pattern": "^/",
+ "description": "The base path to the API. Example: '/api'."
+ },
+ "schemes": {
+ "$ref": "#/definitions/schemesList"
+ },
+ "consumes": {
+ "description": "A list of MIME types accepted by the API.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/mediaTypeList"
+ }
+ ]
+ },
+ "produces": {
+ "description": "A list of MIME types the API can produce.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/mediaTypeList"
+ }
+ ]
+ },
+ "paths": {
+ "$ref": "#/definitions/paths"
+ },
+ "definitions": {
+ "$ref": "#/definitions/definitions"
+ },
+ "parameters": {
+ "$ref": "#/definitions/parameterDefinitions"
+ },
+ "responses": {
+ "$ref": "#/definitions/responseDefinitions"
+ },
+ "security": {
+ "$ref": "#/definitions/security"
+ },
+ "securityDefinitions": {
+ "$ref": "#/definitions/securityDefinitions"
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/tag"
+ },
+ "uniqueItems": true
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/externalDocs"
+ }
+ },
+ "definitions": {
+ "info": {
+ "type": "object",
+ "description": "General information about the API.",
+ "required": [
+ "version",
+ "title"
+ ],
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "title": {
+ "type": "string",
+ "description": "A unique and precise title of the API."
+ },
+ "version": {
+ "type": "string",
+ "description": "A semantic version number of the API."
+ },
+ "description": {
+ "type": "string",
+ "description": "A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed."
+ },
+ "termsOfService": {
+ "type": "string",
+ "description": "The terms of service for the API."
+ },
+ "contact": {
+ "$ref": "#/definitions/contact"
+ },
+ "license": {
+ "$ref": "#/definitions/license"
+ }
+ }
+ },
+ "contact": {
+ "type": "object",
+ "description": "Contact information for the owners of the API.",
+ "additionalProperties": false,
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The identifying name of the contact person/organization."
+ },
+ "url": {
+ "type": "string",
+ "description": "The URL pointing to the contact information.",
+ "format": "uri"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact person/organization.",
+ "format": "email"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "license": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "additionalProperties": false,
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the license type. It's encouraged to use an OSI compatible license."
+ },
+ "url": {
+ "type": "string",
+ "description": "The URL pointing to the license.",
+ "format": "uri"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "paths": {
+ "type": "object",
+ "description": "Relative paths to the individual endpoints. They must be relative to the 'basePath'.",
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ },
+ "^/": {
+ "$ref": "#/definitions/pathItem"
+ }
+ },
+ "additionalProperties": false
+ },
+ "definitions": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/schema"
+ },
+ "description": "One or more JSON objects describing the schemas being consumed and produced by the API."
+ },
+ "parameterDefinitions": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/parameter"
+ },
+ "description": "One or more JSON representations for parameters"
+ },
+ "responseDefinitions": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/response"
+ },
+ "description": "One or more JSON representations for responses"
+ },
+ "externalDocs": {
+ "type": "object",
+ "additionalProperties": false,
+ "description": "information about external documentation",
+ "required": [
+ "url"
+ ],
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string",
+ "format": "uri"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "examples": {
+ "type": "object",
+ "additionalProperties": true
+ },
+ "mimeType": {
+ "type": "string",
+ "description": "The MIME type of the HTTP message."
+ },
+ "operation": {
+ "type": "object",
+ "required": [
+ "responses"
+ ],
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "uniqueItems": true
+ },
+ "summary": {
+ "type": "string",
+ "description": "A brief summary of the operation."
+ },
+ "description": {
+ "type": "string",
+ "description": "A longer description of the operation, GitHub Flavored Markdown is allowed."
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/externalDocs"
+ },
+ "operationId": {
+ "type": "string",
+ "description": "A unique identifier of the operation."
+ },
+ "produces": {
+ "description": "A list of MIME types the API can produce.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/mediaTypeList"
+ }
+ ]
+ },
+ "consumes": {
+ "description": "A list of MIME types the API can consume.",
+ "allOf": [
+ {
+ "$ref": "#/definitions/mediaTypeList"
+ }
+ ]
+ },
+ "parameters": {
+ "$ref": "#/definitions/parametersList"
+ },
+ "responses": {
+ "$ref": "#/definitions/responses"
+ },
+ "schemes": {
+ "$ref": "#/definitions/schemesList"
+ },
+ "deprecated": {
+ "type": "boolean",
+ "default": false
+ },
+ "security": {
+ "$ref": "#/definitions/security"
+ }
+ }
+ },
+ "pathItem": {
+ "type": "object",
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "$ref": {
+ "type": "string"
+ },
+ "get": {
+ "$ref": "#/definitions/operation"
+ },
+ "put": {
+ "$ref": "#/definitions/operation"
+ },
+ "post": {
+ "$ref": "#/definitions/operation"
+ },
+ "delete": {
+ "$ref": "#/definitions/operation"
+ },
+ "options": {
+ "$ref": "#/definitions/operation"
+ },
+ "head": {
+ "$ref": "#/definitions/operation"
+ },
+ "patch": {
+ "$ref": "#/definitions/operation"
+ },
+ "parameters": {
+ "$ref": "#/definitions/parametersList"
+ }
+ }
+ },
+ "responses": {
+ "type": "object",
+ "description": "Response objects names can either be any valid HTTP status code or 'default'.",
+ "minProperties": 1,
+ "additionalProperties": false,
+ "patternProperties": {
+ "^([0-9]{3})$|^(default)$": {
+ "$ref": "#/definitions/responseValue"
+ },
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "not": {
+ "type": "object",
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ }
+ },
+ "responseValue": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/response"
+ },
+ {
+ "$ref": "#/definitions/jsonReference"
+ }
+ ]
+ },
+ "response": {
+ "type": "object",
+ "required": [
+ "description"
+ ],
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "schema": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/schema"
+ },
+ {
+ "$ref": "#/definitions/fileSchema"
+ }
+ ]
+ },
+ "headers": {
+ "$ref": "#/definitions/headers"
+ },
+ "examples": {
+ "$ref": "#/definitions/examples"
+ }
+ },
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "headers": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/header"
+ }
+ },
+ "header": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "string",
+ "number",
+ "integer",
+ "boolean",
+ "array"
+ ]
+ },
+ "format": {
+ "type": "string"
+ },
+ "items": {
+ "$ref": "#/definitions/primitivesItems"
+ },
+ "collectionFormat": {
+ "$ref": "#/definitions/collectionFormat"
+ },
+ "default": {
+ "$ref": "#/definitions/default"
+ },
+ "maximum": {
+ "$ref": "#/definitions/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "#/definitions/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "#/definitions/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "#/definitions/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "#/definitions/maxLength"
+ },
+ "minLength": {
+ "$ref": "#/definitions/minLength"
+ },
+ "pattern": {
+ "$ref": "#/definitions/pattern"
+ },
+ "maxItems": {
+ "$ref": "#/definitions/maxItems"
+ },
+ "minItems": {
+ "$ref": "#/definitions/minItems"
+ },
+ "uniqueItems": {
+ "$ref": "#/definitions/uniqueItems"
+ },
+ "enum": {
+ "$ref": "#/definitions/enum"
+ },
+ "multipleOf": {
+ "$ref": "#/definitions/multipleOf"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "vendorExtension": {
+ "description": "Any property starting with x- is valid.",
+ "additionalProperties": true,
+ "additionalItems": true
+ },
+ "bodyParameter": {
+ "type": "object",
+ "required": [
+ "name",
+ "in",
+ "schema"
+ ],
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the parameter."
+ },
+ "in": {
+ "type": "string",
+ "description": "Determines the location of the parameter.",
+ "enum": [
+ "body"
+ ]
+ },
+ "required": {
+ "type": "boolean",
+ "description": "Determines whether or not this parameter is required or optional.",
+ "default": false
+ },
+ "schema": {
+ "$ref": "#/definitions/schema"
+ }
+ },
+ "additionalProperties": false
+ },
+ "headerParameterSubSchema": {
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "required": {
+ "type": "boolean",
+ "description": "Determines whether or not this parameter is required or optional.",
+ "default": false
+ },
+ "in": {
+ "type": "string",
+ "description": "Determines the location of the parameter.",
+ "enum": [
+ "header"
+ ]
+ },
+ "description": {
+ "type": "string",
+ "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the parameter."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "string",
+ "number",
+ "boolean",
+ "integer",
+ "array"
+ ]
+ },
+ "format": {
+ "type": "string"
+ },
+ "items": {
+ "$ref": "#/definitions/primitivesItems"
+ },
+ "collectionFormat": {
+ "$ref": "#/definitions/collectionFormat"
+ },
+ "default": {
+ "$ref": "#/definitions/default"
+ },
+ "maximum": {
+ "$ref": "#/definitions/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "#/definitions/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "#/definitions/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "#/definitions/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "#/definitions/maxLength"
+ },
+ "minLength": {
+ "$ref": "#/definitions/minLength"
+ },
+ "pattern": {
+ "$ref": "#/definitions/pattern"
+ },
+ "maxItems": {
+ "$ref": "#/definitions/maxItems"
+ },
+ "minItems": {
+ "$ref": "#/definitions/minItems"
+ },
+ "uniqueItems": {
+ "$ref": "#/definitions/uniqueItems"
+ },
+ "enum": {
+ "$ref": "#/definitions/enum"
+ },
+ "multipleOf": {
+ "$ref": "#/definitions/multipleOf"
+ }
+ }
+ },
+ "queryParameterSubSchema": {
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "required": {
+ "type": "boolean",
+ "description": "Determines whether or not this parameter is required or optional.",
+ "default": false
+ },
+ "in": {
+ "type": "string",
+ "description": "Determines the location of the parameter.",
+ "enum": [
+ "query"
+ ]
+ },
+ "description": {
+ "type": "string",
+ "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the parameter."
+ },
+ "allowEmptyValue": {
+ "type": "boolean",
+ "default": false,
+ "description": "allows sending a parameter by name only or with an empty value."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "string",
+ "number",
+ "boolean",
+ "integer",
+ "array"
+ ]
+ },
+ "format": {
+ "type": "string"
+ },
+ "items": {
+ "$ref": "#/definitions/primitivesItems"
+ },
+ "collectionFormat": {
+ "$ref": "#/definitions/collectionFormatWithMulti"
+ },
+ "default": {
+ "$ref": "#/definitions/default"
+ },
+ "maximum": {
+ "$ref": "#/definitions/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "#/definitions/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "#/definitions/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "#/definitions/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "#/definitions/maxLength"
+ },
+ "minLength": {
+ "$ref": "#/definitions/minLength"
+ },
+ "pattern": {
+ "$ref": "#/definitions/pattern"
+ },
+ "maxItems": {
+ "$ref": "#/definitions/maxItems"
+ },
+ "minItems": {
+ "$ref": "#/definitions/minItems"
+ },
+ "uniqueItems": {
+ "$ref": "#/definitions/uniqueItems"
+ },
+ "enum": {
+ "$ref": "#/definitions/enum"
+ },
+ "multipleOf": {
+ "$ref": "#/definitions/multipleOf"
+ }
+ }
+ },
+ "formDataParameterSubSchema": {
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "required": {
+ "type": "boolean",
+ "description": "Determines whether or not this parameter is required or optional.",
+ "default": false
+ },
+ "in": {
+ "type": "string",
+ "description": "Determines the location of the parameter.",
+ "enum": [
+ "formData"
+ ]
+ },
+ "description": {
+ "type": "string",
+ "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the parameter."
+ },
+ "allowEmptyValue": {
+ "type": "boolean",
+ "default": false,
+ "description": "allows sending a parameter by name only or with an empty value."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "string",
+ "number",
+ "boolean",
+ "integer",
+ "array",
+ "file"
+ ]
+ },
+ "format": {
+ "type": "string"
+ },
+ "items": {
+ "$ref": "#/definitions/primitivesItems"
+ },
+ "collectionFormat": {
+ "$ref": "#/definitions/collectionFormatWithMulti"
+ },
+ "default": {
+ "$ref": "#/definitions/default"
+ },
+ "maximum": {
+ "$ref": "#/definitions/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "#/definitions/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "#/definitions/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "#/definitions/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "#/definitions/maxLength"
+ },
+ "minLength": {
+ "$ref": "#/definitions/minLength"
+ },
+ "pattern": {
+ "$ref": "#/definitions/pattern"
+ },
+ "maxItems": {
+ "$ref": "#/definitions/maxItems"
+ },
+ "minItems": {
+ "$ref": "#/definitions/minItems"
+ },
+ "uniqueItems": {
+ "$ref": "#/definitions/uniqueItems"
+ },
+ "enum": {
+ "$ref": "#/definitions/enum"
+ },
+ "multipleOf": {
+ "$ref": "#/definitions/multipleOf"
+ }
+ }
+ },
+ "pathParameterSubSchema": {
+ "additionalProperties": false,
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "required": [
+ "required"
+ ],
+ "properties": {
+ "required": {
+ "type": "boolean",
+ "enum": [
+ true
+ ],
+ "description": "Determines whether or not this parameter is required or optional."
+ },
+ "in": {
+ "type": "string",
+ "description": "Determines the location of the parameter.",
+ "enum": [
+ "path"
+ ]
+ },
+ "description": {
+ "type": "string",
+ "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the parameter."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "string",
+ "number",
+ "boolean",
+ "integer",
+ "array"
+ ]
+ },
+ "format": {
+ "type": "string"
+ },
+ "items": {
+ "$ref": "#/definitions/primitivesItems"
+ },
+ "collectionFormat": {
+ "$ref": "#/definitions/collectionFormat"
+ },
+ "default": {
+ "$ref": "#/definitions/default"
+ },
+ "maximum": {
+ "$ref": "#/definitions/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "#/definitions/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "#/definitions/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "#/definitions/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "#/definitions/maxLength"
+ },
+ "minLength": {
+ "$ref": "#/definitions/minLength"
+ },
+ "pattern": {
+ "$ref": "#/definitions/pattern"
+ },
+ "maxItems": {
+ "$ref": "#/definitions/maxItems"
+ },
+ "minItems": {
+ "$ref": "#/definitions/minItems"
+ },
+ "uniqueItems": {
+ "$ref": "#/definitions/uniqueItems"
+ },
+ "enum": {
+ "$ref": "#/definitions/enum"
+ },
+ "multipleOf": {
+ "$ref": "#/definitions/multipleOf"
+ }
+ }
+ },
+ "nonBodyParameter": {
+ "type": "object",
+ "required": [
+ "name",
+ "in",
+ "type"
+ ],
+ "oneOf": [
+ {
+ "$ref": "#/definitions/headerParameterSubSchema"
+ },
+ {
+ "$ref": "#/definitions/formDataParameterSubSchema"
+ },
+ {
+ "$ref": "#/definitions/queryParameterSubSchema"
+ },
+ {
+ "$ref": "#/definitions/pathParameterSubSchema"
+ }
+ ]
+ },
+ "parameter": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/bodyParameter"
+ },
+ {
+ "$ref": "#/definitions/nonBodyParameter"
+ }
+ ]
+ },
+ "schema": {
+ "type": "object",
+ "description": "A deterministic version of a JSON Schema object.",
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "properties": {
+ "$ref": {
+ "type": "string"
+ },
+ "format": {
+ "type": "string"
+ },
+ "title": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/title"
+ },
+ "description": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/description"
+ },
+ "default": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/default"
+ },
+ "multipleOf": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf"
+ },
+ "maximum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
+ },
+ "minLength": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
+ },
+ "pattern": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern"
+ },
+ "maxItems": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
+ },
+ "minItems": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
+ },
+ "uniqueItems": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems"
+ },
+ "maxProperties": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
+ },
+ "minProperties": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
+ },
+ "required": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray"
+ },
+ "enum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/enum"
+ },
+ "additionalProperties": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/schema"
+ },
+ {
+ "type": "boolean"
+ }
+ ],
+ "default": {}
+ },
+ "type": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/type"
+ },
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/schema"
+ },
+ {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "$ref": "#/definitions/schema"
+ }
+ }
+ ],
+ "default": {}
+ },
+ "allOf": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "$ref": "#/definitions/schema"
+ }
+ },
+ "properties": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/schema"
+ },
+ "default": {}
+ },
+ "discriminator": {
+ "type": "string"
+ },
+ "readOnly": {
+ "type": "boolean",
+ "default": false
+ },
+ "xml": {
+ "$ref": "#/definitions/xml"
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/externalDocs"
+ },
+ "example": {}
+ },
+ "additionalProperties": false
+ },
+ "fileSchema": {
+ "type": "object",
+ "description": "A deterministic version of a JSON Schema object.",
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "format": {
+ "type": "string"
+ },
+ "title": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/title"
+ },
+ "description": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/description"
+ },
+ "default": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/default"
+ },
+ "required": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "file"
+ ]
+ },
+ "readOnly": {
+ "type": "boolean",
+ "default": false
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/externalDocs"
+ },
+ "example": {}
+ },
+ "additionalProperties": false
+ },
+ "primitivesItems": {
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "string",
+ "number",
+ "integer",
+ "boolean",
+ "array"
+ ]
+ },
+ "format": {
+ "type": "string"
+ },
+ "items": {
+ "$ref": "#/definitions/primitivesItems"
+ },
+ "collectionFormat": {
+ "$ref": "#/definitions/collectionFormat"
+ },
+ "default": {
+ "$ref": "#/definitions/default"
+ },
+ "maximum": {
+ "$ref": "#/definitions/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "#/definitions/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "#/definitions/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "#/definitions/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "#/definitions/maxLength"
+ },
+ "minLength": {
+ "$ref": "#/definitions/minLength"
+ },
+ "pattern": {
+ "$ref": "#/definitions/pattern"
+ },
+ "maxItems": {
+ "$ref": "#/definitions/maxItems"
+ },
+ "minItems": {
+ "$ref": "#/definitions/minItems"
+ },
+ "uniqueItems": {
+ "$ref": "#/definitions/uniqueItems"
+ },
+ "enum": {
+ "$ref": "#/definitions/enum"
+ },
+ "multipleOf": {
+ "$ref": "#/definitions/multipleOf"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "security": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/securityRequirement"
+ },
+ "uniqueItems": true
+ },
+ "securityRequirement": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "uniqueItems": true
+ }
+ },
+ "xml": {
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "namespace": {
+ "type": "string"
+ },
+ "prefix": {
+ "type": "string"
+ },
+ "attribute": {
+ "type": "boolean",
+ "default": false
+ },
+ "wrapped": {
+ "type": "boolean",
+ "default": false
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "tag": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/externalDocs"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "securityDefinitions": {
+ "type": "object",
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/basicAuthenticationSecurity"
+ },
+ {
+ "$ref": "#/definitions/apiKeySecurity"
+ },
+ {
+ "$ref": "#/definitions/oauth2ImplicitSecurity"
+ },
+ {
+ "$ref": "#/definitions/oauth2PasswordSecurity"
+ },
+ {
+ "$ref": "#/definitions/oauth2ApplicationSecurity"
+ },
+ {
+ "$ref": "#/definitions/oauth2AccessCodeSecurity"
+ }
+ ]
+ }
+ },
+ "basicAuthenticationSecurity": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "basic"
+ ]
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "apiKeySecurity": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "type",
+ "name",
+ "in"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "apiKey"
+ ]
+ },
+ "name": {
+ "type": "string"
+ },
+ "in": {
+ "type": "string",
+ "enum": [
+ "header",
+ "query"
+ ]
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "oauth2ImplicitSecurity": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "type",
+ "flow",
+ "authorizationUrl"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "oauth2"
+ ]
+ },
+ "flow": {
+ "type": "string",
+ "enum": [
+ "implicit"
+ ]
+ },
+ "scopes": {
+ "$ref": "#/definitions/oauth2Scopes"
+ },
+ "authorizationUrl": {
+ "type": "string",
+ "format": "uri"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "oauth2PasswordSecurity": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "type",
+ "flow",
+ "tokenUrl"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "oauth2"
+ ]
+ },
+ "flow": {
+ "type": "string",
+ "enum": [
+ "password"
+ ]
+ },
+ "scopes": {
+ "$ref": "#/definitions/oauth2Scopes"
+ },
+ "tokenUrl": {
+ "type": "string",
+ "format": "uri"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "oauth2ApplicationSecurity": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "type",
+ "flow",
+ "tokenUrl"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "oauth2"
+ ]
+ },
+ "flow": {
+ "type": "string",
+ "enum": [
+ "application"
+ ]
+ },
+ "scopes": {
+ "$ref": "#/definitions/oauth2Scopes"
+ },
+ "tokenUrl": {
+ "type": "string",
+ "format": "uri"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "oauth2AccessCodeSecurity": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "type",
+ "flow",
+ "authorizationUrl",
+ "tokenUrl"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "oauth2"
+ ]
+ },
+ "flow": {
+ "type": "string",
+ "enum": [
+ "accessCode"
+ ]
+ },
+ "scopes": {
+ "$ref": "#/definitions/oauth2Scopes"
+ },
+ "authorizationUrl": {
+ "type": "string",
+ "format": "uri"
+ },
+ "tokenUrl": {
+ "type": "string",
+ "format": "uri"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {
+ "$ref": "#/definitions/vendorExtension"
+ }
+ }
+ },
+ "oauth2Scopes": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "mediaTypeList": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/mimeType"
+ },
+ "uniqueItems": true
+ },
+ "parametersList": {
+ "type": "array",
+ "description": "The parameters needed to send a valid API call.",
+ "additionalItems": false,
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/parameter"
+ },
+ {
+ "$ref": "#/definitions/jsonReference"
+ }
+ ]
+ },
+ "uniqueItems": true
+ },
+ "schemesList": {
+ "type": "array",
+ "description": "The transfer protocol of the API.",
+ "items": {
+ "type": "string",
+ "enum": [
+ "http",
+ "https",
+ "ws",
+ "wss"
+ ]
+ },
+ "uniqueItems": true
+ },
+ "collectionFormat": {
+ "type": "string",
+ "enum": [
+ "csv",
+ "ssv",
+ "tsv",
+ "pipes"
+ ],
+ "default": "csv"
+ },
+ "collectionFormatWithMulti": {
+ "type": "string",
+ "enum": [
+ "csv",
+ "ssv",
+ "tsv",
+ "pipes",
+ "multi"
+ ],
+ "default": "csv"
+ },
+ "title": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/title"
+ },
+ "description": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/description"
+ },
+ "default": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/default"
+ },
+ "multipleOf": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf"
+ },
+ "maximum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum"
+ },
+ "exclusiveMaximum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"
+ },
+ "minimum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum"
+ },
+ "exclusiveMinimum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"
+ },
+ "maxLength": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
+ },
+ "minLength": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
+ },
+ "pattern": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern"
+ },
+ "maxItems": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
+ },
+ "minItems": {
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
+ },
+ "uniqueItems": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems"
+ },
+ "enum": {
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/enum"
+ },
+ "jsonReference": {
+ "type": "object",
+ "required": [
+ "$ref"
+ ],
+ "additionalProperties": false,
+ "properties": {
+ "$ref": {
+ "type": "string"
+ }
+ }
+ }
+ }
+}
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/schemas/schema.3.0.json b/test/Swashbuckle.AspNetCore.IntegrationTests/schemas/schema.3.0.json
new file mode 100644
index 0000000000..a40570a367
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/schemas/schema.3.0.json
@@ -0,0 +1,1651 @@
+{
+ "id": "https://spec.openapis.org/oas/3.0/schema/2024-10-18",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "description": "The description of OpenAPI v3.0.x Documents",
+ "type": "object",
+ "required": [
+ "openapi",
+ "info",
+ "paths"
+ ],
+ "properties": {
+ "openapi": {
+ "type": "string",
+ "pattern": "^3\\.0\\.\\d(-.+)?$"
+ },
+ "info": {
+ "$ref": "#/definitions/Info"
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/ExternalDocumentation"
+ },
+ "servers": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Server"
+ }
+ },
+ "security": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/SecurityRequirement"
+ }
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Tag"
+ },
+ "uniqueItems": true
+ },
+ "paths": {
+ "$ref": "#/definitions/Paths"
+ },
+ "components": {
+ "$ref": "#/definitions/Components"
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false,
+ "definitions": {
+ "Reference": {
+ "type": "object",
+ "required": [
+ "$ref"
+ ],
+ "patternProperties": {
+ "^\\$ref$": {
+ "type": "string",
+ "format": "uri-reference"
+ }
+ }
+ },
+ "Info": {
+ "type": "object",
+ "required": [
+ "title",
+ "version"
+ ],
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "termsOfService": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "contact": {
+ "$ref": "#/definitions/Contact"
+ },
+ "license": {
+ "$ref": "#/definitions/License"
+ },
+ "version": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "Contact": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "email": {
+ "type": "string",
+ "format": "email"
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "License": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string",
+ "format": "uri-reference"
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "Server": {
+ "type": "object",
+ "required": [
+ "url"
+ ],
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "variables": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/ServerVariable"
+ }
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "ServerVariable": {
+ "type": "object",
+ "required": [
+ "default"
+ ],
+ "properties": {
+ "enum": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "default": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "Components": {
+ "type": "object",
+ "properties": {
+ "schemas": {
+ "type": "object",
+ "patternProperties": {
+ "^[a-zA-Z0-9\\.\\-_]+$": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Schema"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ }
+ }
+ },
+ "responses": {
+ "type": "object",
+ "patternProperties": {
+ "^[a-zA-Z0-9\\.\\-_]+$": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Reference"
+ },
+ {
+ "$ref": "#/definitions/Response"
+ }
+ ]
+ }
+ }
+ },
+ "parameters": {
+ "type": "object",
+ "patternProperties": {
+ "^[a-zA-Z0-9\\.\\-_]+$": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Reference"
+ },
+ {
+ "$ref": "#/definitions/Parameter"
+ }
+ ]
+ }
+ }
+ },
+ "examples": {
+ "type": "object",
+ "patternProperties": {
+ "^[a-zA-Z0-9\\.\\-_]+$": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Reference"
+ },
+ {
+ "$ref": "#/definitions/Example"
+ }
+ ]
+ }
+ }
+ },
+ "requestBodies": {
+ "type": "object",
+ "patternProperties": {
+ "^[a-zA-Z0-9\\.\\-_]+$": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Reference"
+ },
+ {
+ "$ref": "#/definitions/RequestBody"
+ }
+ ]
+ }
+ }
+ },
+ "headers": {
+ "type": "object",
+ "patternProperties": {
+ "^[a-zA-Z0-9\\.\\-_]+$": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Reference"
+ },
+ {
+ "$ref": "#/definitions/Header"
+ }
+ ]
+ }
+ }
+ },
+ "securitySchemes": {
+ "type": "object",
+ "patternProperties": {
+ "^[a-zA-Z0-9\\.\\-_]+$": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Reference"
+ },
+ {
+ "$ref": "#/definitions/SecurityScheme"
+ }
+ ]
+ }
+ }
+ },
+ "links": {
+ "type": "object",
+ "patternProperties": {
+ "^[a-zA-Z0-9\\.\\-_]+$": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Reference"
+ },
+ {
+ "$ref": "#/definitions/Link"
+ }
+ ]
+ }
+ }
+ },
+ "callbacks": {
+ "type": "object",
+ "patternProperties": {
+ "^[a-zA-Z0-9\\.\\-_]+$": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Reference"
+ },
+ {
+ "$ref": "#/definitions/Callback"
+ }
+ ]
+ }
+ }
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "Schema": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "multipleOf": {
+ "type": "number",
+ "minimum": 0,
+ "exclusiveMinimum": true
+ },
+ "maximum": {
+ "type": "number"
+ },
+ "exclusiveMaximum": {
+ "type": "boolean",
+ "default": false
+ },
+ "minimum": {
+ "type": "number"
+ },
+ "exclusiveMinimum": {
+ "type": "boolean",
+ "default": false
+ },
+ "maxLength": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "minLength": {
+ "type": "integer",
+ "minimum": 0,
+ "default": 0
+ },
+ "pattern": {
+ "type": "string",
+ "format": "regex"
+ },
+ "maxItems": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "minItems": {
+ "type": "integer",
+ "minimum": 0,
+ "default": 0
+ },
+ "uniqueItems": {
+ "type": "boolean",
+ "default": false
+ },
+ "maxProperties": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "minProperties": {
+ "type": "integer",
+ "minimum": 0,
+ "default": 0
+ },
+ "required": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "minItems": 1,
+ "uniqueItems": true
+ },
+ "enum": {
+ "type": "array",
+ "items": {},
+ "minItems": 1,
+ "uniqueItems": false
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "array",
+ "boolean",
+ "integer",
+ "number",
+ "object",
+ "string"
+ ]
+ },
+ "not": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Schema"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ },
+ "allOf": {
+ "type": "array",
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Schema"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ }
+ },
+ "oneOf": {
+ "type": "array",
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Schema"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ }
+ },
+ "anyOf": {
+ "type": "array",
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Schema"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ }
+ },
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Schema"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ },
+ "properties": {
+ "type": "object",
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Schema"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ }
+ },
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Schema"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ },
+ {
+ "type": "boolean"
+ }
+ ],
+ "default": true
+ },
+ "description": {
+ "type": "string"
+ },
+ "format": {
+ "type": "string"
+ },
+ "default": {},
+ "nullable": {
+ "type": "boolean",
+ "default": false
+ },
+ "discriminator": {
+ "$ref": "#/definitions/Discriminator"
+ },
+ "readOnly": {
+ "type": "boolean",
+ "default": false
+ },
+ "writeOnly": {
+ "type": "boolean",
+ "default": false
+ },
+ "example": {},
+ "externalDocs": {
+ "$ref": "#/definitions/ExternalDocumentation"
+ },
+ "deprecated": {
+ "type": "boolean",
+ "default": false
+ },
+ "xml": {
+ "$ref": "#/definitions/XML"
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "Discriminator": {
+ "type": "object",
+ "required": [
+ "propertyName"
+ ],
+ "properties": {
+ "propertyName": {
+ "type": "string"
+ },
+ "mapping": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "XML": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "namespace": {
+ "type": "string",
+ "format": "uri"
+ },
+ "prefix": {
+ "type": "string"
+ },
+ "attribute": {
+ "type": "boolean",
+ "default": false
+ },
+ "wrapped": {
+ "type": "boolean",
+ "default": false
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "Response": {
+ "type": "object",
+ "required": [
+ "description"
+ ],
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "headers": {
+ "type": "object",
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Header"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ }
+ },
+ "content": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/MediaType"
+ }
+ },
+ "links": {
+ "type": "object",
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Link"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ }
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "MediaType": {
+ "type": "object",
+ "properties": {
+ "schema": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Schema"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ },
+ "example": {},
+ "examples": {
+ "type": "object",
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Example"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ }
+ },
+ "encoding": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/Encoding"
+ }
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false,
+ "allOf": [
+ {
+ "$ref": "#/definitions/ExampleXORExamples"
+ }
+ ]
+ },
+ "Example": {
+ "type": "object",
+ "properties": {
+ "summary": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "value": {},
+ "externalValue": {
+ "type": "string",
+ "format": "uri-reference"
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "Header": {
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "required": {
+ "type": "boolean",
+ "default": false
+ },
+ "deprecated": {
+ "type": "boolean",
+ "default": false
+ },
+ "allowEmptyValue": {
+ "type": "boolean",
+ "default": false
+ },
+ "style": {
+ "type": "string",
+ "enum": [
+ "simple"
+ ],
+ "default": "simple"
+ },
+ "explode": {
+ "type": "boolean"
+ },
+ "allowReserved": {
+ "type": "boolean",
+ "default": false
+ },
+ "schema": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Schema"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ },
+ "content": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/MediaType"
+ },
+ "minProperties": 1,
+ "maxProperties": 1
+ },
+ "example": {},
+ "examples": {
+ "type": "object",
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Example"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ }
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false,
+ "allOf": [
+ {
+ "$ref": "#/definitions/ExampleXORExamples"
+ },
+ {
+ "$ref": "#/definitions/SchemaXORContent"
+ }
+ ]
+ },
+ "Paths": {
+ "type": "object",
+ "patternProperties": {
+ "^\\/": {
+ "$ref": "#/definitions/PathItem"
+ },
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "PathItem": {
+ "type": "object",
+ "properties": {
+ "$ref": {
+ "type": "string"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "get": {
+ "$ref": "#/definitions/Operation"
+ },
+ "put": {
+ "$ref": "#/definitions/Operation"
+ },
+ "post": {
+ "$ref": "#/definitions/Operation"
+ },
+ "delete": {
+ "$ref": "#/definitions/Operation"
+ },
+ "options": {
+ "$ref": "#/definitions/Operation"
+ },
+ "head": {
+ "$ref": "#/definitions/Operation"
+ },
+ "patch": {
+ "$ref": "#/definitions/Operation"
+ },
+ "trace": {
+ "$ref": "#/definitions/Operation"
+ },
+ "servers": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Server"
+ }
+ },
+ "parameters": {
+ "type": "array",
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Parameter"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ },
+ "uniqueItems": true
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "Operation": {
+ "type": "object",
+ "required": [
+ "responses"
+ ],
+ "properties": {
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "summary": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/ExternalDocumentation"
+ },
+ "operationId": {
+ "type": "string"
+ },
+ "parameters": {
+ "type": "array",
+ "items": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Parameter"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ },
+ "uniqueItems": true
+ },
+ "requestBody": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/RequestBody"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ },
+ "responses": {
+ "$ref": "#/definitions/Responses"
+ },
+ "callbacks": {
+ "type": "object",
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Callback"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ }
+ },
+ "deprecated": {
+ "type": "boolean",
+ "default": false
+ },
+ "security": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/SecurityRequirement"
+ }
+ },
+ "servers": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Server"
+ }
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "Responses": {
+ "type": "object",
+ "properties": {
+ "default": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Response"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ }
+ },
+ "patternProperties": {
+ "^[1-5](?:\\d{2}|XX)$": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Response"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ },
+ "^x-": {}
+ },
+ "minProperties": 1,
+ "additionalProperties": false
+ },
+ "SecurityRequirement": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "Tag": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "externalDocs": {
+ "$ref": "#/definitions/ExternalDocumentation"
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "ExternalDocumentation": {
+ "type": "object",
+ "required": [
+ "url"
+ ],
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string",
+ "format": "uri-reference"
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "ExampleXORExamples": {
+ "description": "Example and examples are mutually exclusive",
+ "not": {
+ "required": [
+ "example",
+ "examples"
+ ]
+ }
+ },
+ "SchemaXORContent": {
+ "description": "Schema and content are mutually exclusive, at least one is required",
+ "not": {
+ "required": [
+ "schema",
+ "content"
+ ]
+ },
+ "oneOf": [
+ {
+ "required": [
+ "schema"
+ ]
+ },
+ {
+ "required": [
+ "content"
+ ],
+ "description": "Some properties are not allowed if content is present",
+ "allOf": [
+ {
+ "not": {
+ "required": [
+ "style"
+ ]
+ }
+ },
+ {
+ "not": {
+ "required": [
+ "explode"
+ ]
+ }
+ },
+ {
+ "not": {
+ "required": [
+ "allowReserved"
+ ]
+ }
+ },
+ {
+ "not": {
+ "required": [
+ "example"
+ ]
+ }
+ },
+ {
+ "not": {
+ "required": [
+ "examples"
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "Parameter": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "in": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "required": {
+ "type": "boolean",
+ "default": false
+ },
+ "deprecated": {
+ "type": "boolean",
+ "default": false
+ },
+ "allowEmptyValue": {
+ "type": "boolean",
+ "default": false
+ },
+ "style": {
+ "type": "string"
+ },
+ "explode": {
+ "type": "boolean"
+ },
+ "allowReserved": {
+ "type": "boolean",
+ "default": false
+ },
+ "schema": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Schema"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ },
+ "content": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/MediaType"
+ },
+ "minProperties": 1,
+ "maxProperties": 1
+ },
+ "example": {},
+ "examples": {
+ "type": "object",
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Example"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ }
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false,
+ "required": [
+ "name",
+ "in"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/ExampleXORExamples"
+ },
+ {
+ "$ref": "#/definitions/SchemaXORContent"
+ }
+ ],
+ "oneOf": [
+ {
+ "$ref": "#/definitions/PathParameter"
+ },
+ {
+ "$ref": "#/definitions/QueryParameter"
+ },
+ {
+ "$ref": "#/definitions/HeaderParameter"
+ },
+ {
+ "$ref": "#/definitions/CookieParameter"
+ }
+ ]
+ },
+ "PathParameter": {
+ "description": "Parameter in path",
+ "required": [
+ "required"
+ ],
+ "properties": {
+ "in": {
+ "enum": [
+ "path"
+ ]
+ },
+ "style": {
+ "enum": [
+ "matrix",
+ "label",
+ "simple"
+ ],
+ "default": "simple"
+ },
+ "required": {
+ "enum": [
+ true
+ ]
+ }
+ }
+ },
+ "QueryParameter": {
+ "description": "Parameter in query",
+ "properties": {
+ "in": {
+ "enum": [
+ "query"
+ ]
+ },
+ "style": {
+ "enum": [
+ "form",
+ "spaceDelimited",
+ "pipeDelimited",
+ "deepObject"
+ ],
+ "default": "form"
+ }
+ }
+ },
+ "HeaderParameter": {
+ "description": "Parameter in header",
+ "properties": {
+ "in": {
+ "enum": [
+ "header"
+ ]
+ },
+ "style": {
+ "enum": [
+ "simple"
+ ],
+ "default": "simple"
+ }
+ }
+ },
+ "CookieParameter": {
+ "description": "Parameter in cookie",
+ "properties": {
+ "in": {
+ "enum": [
+ "cookie"
+ ]
+ },
+ "style": {
+ "enum": [
+ "form"
+ ],
+ "default": "form"
+ }
+ }
+ },
+ "RequestBody": {
+ "type": "object",
+ "required": [
+ "content"
+ ],
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "content": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/MediaType"
+ }
+ },
+ "required": {
+ "type": "boolean",
+ "default": false
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "SecurityScheme": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/APIKeySecurityScheme"
+ },
+ {
+ "$ref": "#/definitions/HTTPSecurityScheme"
+ },
+ {
+ "$ref": "#/definitions/OAuth2SecurityScheme"
+ },
+ {
+ "$ref": "#/definitions/OpenIdConnectSecurityScheme"
+ }
+ ]
+ },
+ "APIKeySecurityScheme": {
+ "type": "object",
+ "required": [
+ "type",
+ "name",
+ "in"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "apiKey"
+ ]
+ },
+ "name": {
+ "type": "string"
+ },
+ "in": {
+ "type": "string",
+ "enum": [
+ "header",
+ "query",
+ "cookie"
+ ]
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "HTTPSecurityScheme": {
+ "type": "object",
+ "required": [
+ "scheme",
+ "type"
+ ],
+ "properties": {
+ "scheme": {
+ "type": "string"
+ },
+ "bearerFormat": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "http"
+ ]
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false,
+ "oneOf": [
+ {
+ "description": "Bearer",
+ "properties": {
+ "scheme": {
+ "type": "string",
+ "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$"
+ }
+ }
+ },
+ {
+ "description": "Non Bearer",
+ "not": {
+ "required": [
+ "bearerFormat"
+ ]
+ },
+ "properties": {
+ "scheme": {
+ "not": {
+ "type": "string",
+ "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$"
+ }
+ }
+ }
+ }
+ ]
+ },
+ "OAuth2SecurityScheme": {
+ "type": "object",
+ "required": [
+ "type",
+ "flows"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "oauth2"
+ ]
+ },
+ "flows": {
+ "$ref": "#/definitions/OAuthFlows"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "OpenIdConnectSecurityScheme": {
+ "type": "object",
+ "required": [
+ "type",
+ "openIdConnectUrl"
+ ],
+ "properties": {
+ "type": {
+ "type": "string",
+ "enum": [
+ "openIdConnect"
+ ]
+ },
+ "openIdConnectUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "OAuthFlows": {
+ "type": "object",
+ "properties": {
+ "implicit": {
+ "$ref": "#/definitions/ImplicitOAuthFlow"
+ },
+ "password": {
+ "$ref": "#/definitions/PasswordOAuthFlow"
+ },
+ "clientCredentials": {
+ "$ref": "#/definitions/ClientCredentialsFlow"
+ },
+ "authorizationCode": {
+ "$ref": "#/definitions/AuthorizationCodeOAuthFlow"
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "ImplicitOAuthFlow": {
+ "type": "object",
+ "required": [
+ "authorizationUrl",
+ "scopes"
+ ],
+ "properties": {
+ "authorizationUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "refreshUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "scopes": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "PasswordOAuthFlow": {
+ "type": "object",
+ "required": [
+ "tokenUrl",
+ "scopes"
+ ],
+ "properties": {
+ "tokenUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "refreshUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "scopes": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "ClientCredentialsFlow": {
+ "type": "object",
+ "required": [
+ "tokenUrl",
+ "scopes"
+ ],
+ "properties": {
+ "tokenUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "refreshUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "scopes": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "AuthorizationCodeOAuthFlow": {
+ "type": "object",
+ "required": [
+ "authorizationUrl",
+ "tokenUrl",
+ "scopes"
+ ],
+ "properties": {
+ "authorizationUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "tokenUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "refreshUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "scopes": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ },
+ "Link": {
+ "type": "object",
+ "properties": {
+ "operationId": {
+ "type": "string"
+ },
+ "operationRef": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "parameters": {
+ "type": "object",
+ "additionalProperties": {}
+ },
+ "requestBody": {},
+ "description": {
+ "type": "string"
+ },
+ "server": {
+ "$ref": "#/definitions/Server"
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false,
+ "not": {
+ "description": "Operation Id and Operation Ref are mutually exclusive",
+ "required": [
+ "operationId",
+ "operationRef"
+ ]
+ }
+ },
+ "Callback": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/definitions/PathItem"
+ },
+ "patternProperties": {
+ "^x-": {}
+ }
+ },
+ "Encoding": {
+ "type": "object",
+ "properties": {
+ "contentType": {
+ "type": "string"
+ },
+ "headers": {
+ "type": "object",
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/Header"
+ },
+ {
+ "$ref": "#/definitions/Reference"
+ }
+ ]
+ }
+ },
+ "style": {
+ "type": "string",
+ "enum": [
+ "form",
+ "spaceDelimited",
+ "pipeDelimited",
+ "deepObject"
+ ]
+ },
+ "explode": {
+ "type": "boolean"
+ },
+ "allowReserved": {
+ "type": "boolean",
+ "default": false
+ }
+ },
+ "patternProperties": {
+ "^x-": {}
+ },
+ "additionalProperties": false
+ }
+ }
+}
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/schemas/schema.3.1.json b/test/Swashbuckle.AspNetCore.IntegrationTests/schemas/schema.3.1.json
new file mode 100644
index 0000000000..744f94a788
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/schemas/schema.3.1.json
@@ -0,0 +1,1411 @@
+{
+ "$id": "https://spec.openapis.org/oas/3.1/schema/2025-09-15",
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "description": "The description of OpenAPI v3.1.x Documents without Schema Object validation",
+ "type": "object",
+ "properties": {
+ "openapi": {
+ "type": "string",
+ "pattern": "^3\\.1\\.\\d+(-.+)?$"
+ },
+ "info": {
+ "$ref": "#/$defs/info"
+ },
+ "jsonSchemaDialect": {
+ "type": "string",
+ "format": "uri-reference",
+ "default": "https://spec.openapis.org/oas/3.1/dialect/2024-11-10"
+ },
+ "servers": {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/server"
+ },
+ "default": [
+ {
+ "url": "/"
+ }
+ ]
+ },
+ "paths": {
+ "$ref": "#/$defs/paths"
+ },
+ "webhooks": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/path-item"
+ }
+ },
+ "components": {
+ "$ref": "#/$defs/components"
+ },
+ "security": {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/security-requirement"
+ }
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/tag"
+ }
+ },
+ "externalDocs": {
+ "$ref": "#/$defs/external-documentation"
+ }
+ },
+ "required": [
+ "openapi",
+ "info"
+ ],
+ "anyOf": [
+ {
+ "required": [
+ "paths"
+ ]
+ },
+ {
+ "required": [
+ "components"
+ ]
+ },
+ {
+ "required": [
+ "webhooks"
+ ]
+ }
+ ],
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false,
+ "$defs": {
+ "info": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#info-object",
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "termsOfService": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "contact": {
+ "$ref": "#/$defs/contact"
+ },
+ "license": {
+ "$ref": "#/$defs/license"
+ },
+ "version": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "title",
+ "version"
+ ],
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "contact": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#contact-object",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "email": {
+ "type": "string",
+ "format": "email"
+ }
+ },
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "license": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#license-object",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "identifier": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string",
+ "format": "uri-reference"
+ }
+ },
+ "required": [
+ "name"
+ ],
+ "dependentSchemas": {
+ "identifier": {
+ "not": {
+ "required": [
+ "url"
+ ]
+ }
+ }
+ },
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "server": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#server-object",
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "variables": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/server-variable"
+ }
+ }
+ },
+ "required": [
+ "url"
+ ],
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "server-variable": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#server-variable-object",
+ "type": "object",
+ "properties": {
+ "enum": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "minItems": 1
+ },
+ "default": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "default"
+ ],
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "components": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#components-object",
+ "type": "object",
+ "properties": {
+ "schemas": {
+ "type": "object",
+ "additionalProperties": {
+ "$dynamicRef": "#meta"
+ }
+ },
+ "responses": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/response-or-reference"
+ }
+ },
+ "parameters": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/parameter-or-reference"
+ }
+ },
+ "examples": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/example-or-reference"
+ }
+ },
+ "requestBodies": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/request-body-or-reference"
+ }
+ },
+ "headers": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/header-or-reference"
+ }
+ },
+ "securitySchemes": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/security-scheme-or-reference"
+ }
+ },
+ "links": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/link-or-reference"
+ }
+ },
+ "callbacks": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/callbacks-or-reference"
+ }
+ },
+ "pathItems": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/path-item"
+ }
+ }
+ },
+ "patternProperties": {
+ "^(?:schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$": {
+ "$comment": "Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected",
+ "propertyNames": {
+ "pattern": "^[a-zA-Z0-9._-]+$"
+ }
+ }
+ },
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "paths": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#paths-object",
+ "type": "object",
+ "patternProperties": {
+ "^/": {
+ "$ref": "#/$defs/path-item"
+ }
+ },
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "path-item": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#path-item-object",
+ "type": "object",
+ "properties": {
+ "$ref": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "servers": {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/server"
+ }
+ },
+ "parameters": {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/parameter-or-reference"
+ }
+ },
+ "get": {
+ "$ref": "#/$defs/operation"
+ },
+ "put": {
+ "$ref": "#/$defs/operation"
+ },
+ "post": {
+ "$ref": "#/$defs/operation"
+ },
+ "delete": {
+ "$ref": "#/$defs/operation"
+ },
+ "options": {
+ "$ref": "#/$defs/operation"
+ },
+ "head": {
+ "$ref": "#/$defs/operation"
+ },
+ "patch": {
+ "$ref": "#/$defs/operation"
+ },
+ "trace": {
+ "$ref": "#/$defs/operation"
+ }
+ },
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "operation": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#operation-object",
+ "type": "object",
+ "properties": {
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "summary": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "externalDocs": {
+ "$ref": "#/$defs/external-documentation"
+ },
+ "operationId": {
+ "type": "string"
+ },
+ "parameters": {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/parameter-or-reference"
+ }
+ },
+ "requestBody": {
+ "$ref": "#/$defs/request-body-or-reference"
+ },
+ "responses": {
+ "$ref": "#/$defs/responses"
+ },
+ "callbacks": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/callbacks-or-reference"
+ }
+ },
+ "deprecated": {
+ "default": false,
+ "type": "boolean"
+ },
+ "security": {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/security-requirement"
+ }
+ },
+ "servers": {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/server"
+ }
+ }
+ },
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "external-documentation": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#external-documentation-object",
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string",
+ "format": "uri-reference"
+ }
+ },
+ "required": [
+ "url"
+ ],
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "parameter": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#parameter-object",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "in": {
+ "enum": [
+ "query",
+ "header",
+ "path",
+ "cookie"
+ ]
+ },
+ "description": {
+ "type": "string"
+ },
+ "required": {
+ "default": false,
+ "type": "boolean"
+ },
+ "deprecated": {
+ "default": false,
+ "type": "boolean"
+ },
+ "schema": {
+ "$dynamicRef": "#meta"
+ },
+ "content": {
+ "$ref": "#/$defs/content",
+ "minProperties": 1,
+ "maxProperties": 1
+ }
+ },
+ "required": [
+ "name",
+ "in"
+ ],
+ "oneOf": [
+ {
+ "required": [
+ "schema"
+ ]
+ },
+ {
+ "required": [
+ "content"
+ ]
+ }
+ ],
+ "if": {
+ "properties": {
+ "in": {
+ "const": "query"
+ }
+ }
+ },
+ "then": {
+ "properties": {
+ "allowEmptyValue": {
+ "default": false,
+ "type": "boolean"
+ }
+ }
+ },
+ "dependentSchemas": {
+ "schema": {
+ "properties": {
+ "style": {
+ "type": "string"
+ },
+ "explode": {
+ "type": "boolean"
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/$defs/examples"
+ },
+ {
+ "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path"
+ },
+ {
+ "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-header"
+ },
+ {
+ "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-query"
+ },
+ {
+ "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-cookie"
+ },
+ {
+ "$ref": "#/$defs/styles-for-form"
+ }
+ ],
+ "$defs": {
+ "styles-for-path": {
+ "if": {
+ "properties": {
+ "in": {
+ "const": "path"
+ }
+ }
+ },
+ "then": {
+ "properties": {
+ "style": {
+ "default": "simple",
+ "enum": [
+ "matrix",
+ "label",
+ "simple"
+ ]
+ },
+ "required": {
+ "const": true
+ }
+ },
+ "required": [
+ "required"
+ ]
+ }
+ },
+ "styles-for-header": {
+ "if": {
+ "properties": {
+ "in": {
+ "const": "header"
+ }
+ }
+ },
+ "then": {
+ "properties": {
+ "style": {
+ "default": "simple",
+ "const": "simple"
+ }
+ }
+ }
+ },
+ "styles-for-query": {
+ "if": {
+ "properties": {
+ "in": {
+ "const": "query"
+ }
+ }
+ },
+ "then": {
+ "properties": {
+ "style": {
+ "default": "form",
+ "enum": [
+ "form",
+ "spaceDelimited",
+ "pipeDelimited",
+ "deepObject"
+ ]
+ },
+ "allowReserved": {
+ "default": false,
+ "type": "boolean"
+ }
+ }
+ }
+ },
+ "styles-for-cookie": {
+ "if": {
+ "properties": {
+ "in": {
+ "const": "cookie"
+ }
+ }
+ },
+ "then": {
+ "properties": {
+ "style": {
+ "default": "form",
+ "const": "form"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "parameter-or-reference": {
+ "if": {
+ "type": "object",
+ "required": [
+ "$ref"
+ ]
+ },
+ "then": {
+ "$ref": "#/$defs/reference"
+ },
+ "else": {
+ "$ref": "#/$defs/parameter"
+ }
+ },
+ "request-body": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#request-body-object",
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "content": {
+ "$ref": "#/$defs/content"
+ },
+ "required": {
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "content"
+ ],
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "request-body-or-reference": {
+ "if": {
+ "type": "object",
+ "required": [
+ "$ref"
+ ]
+ },
+ "then": {
+ "$ref": "#/$defs/reference"
+ },
+ "else": {
+ "$ref": "#/$defs/request-body"
+ }
+ },
+ "content": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#fixed-fields-10",
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/media-type"
+ },
+ "propertyNames": {
+ "format": "media-range"
+ }
+ },
+ "media-type": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#media-type-object",
+ "type": "object",
+ "properties": {
+ "schema": {
+ "$dynamicRef": "#meta"
+ },
+ "encoding": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/encoding"
+ }
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/$defs/specification-extensions"
+ },
+ {
+ "$ref": "#/$defs/examples"
+ }
+ ],
+ "unevaluatedProperties": false
+ },
+ "encoding": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#encoding-object",
+ "type": "object",
+ "properties": {
+ "contentType": {
+ "type": "string",
+ "format": "media-range"
+ },
+ "headers": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/header-or-reference"
+ }
+ },
+ "style": {
+ "enum": [
+ "form",
+ "spaceDelimited",
+ "pipeDelimited",
+ "deepObject"
+ ]
+ },
+ "explode": {
+ "type": "boolean"
+ },
+ "allowReserved": {
+ "type": "boolean"
+ }
+ },
+ "dependentSchemas": {
+ "style": {
+ "properties": {
+ "allowReserved": {
+ "default": false
+ }
+ }
+ },
+ "explode": {
+ "properties": {
+ "style": {
+ "default": "form"
+ },
+ "allowReserved": {
+ "default": false
+ }
+ }
+ },
+ "allowReserved": {
+ "properties": {
+ "style": {
+ "default": "form"
+ }
+ }
+ }
+ },
+ "allOf": [
+ {
+ "$ref": "#/$defs/specification-extensions"
+ },
+ {
+ "$ref": "#/$defs/styles-for-form"
+ }
+ ],
+ "unevaluatedProperties": false
+ },
+ "responses": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#responses-object",
+ "type": "object",
+ "properties": {
+ "default": {
+ "$ref": "#/$defs/response-or-reference"
+ }
+ },
+ "patternProperties": {
+ "^[1-5](?:[0-9]{2}|XX)$": {
+ "$ref": "#/$defs/response-or-reference"
+ }
+ },
+ "minProperties": 1,
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false,
+ "if": {
+ "$comment": "either default, or at least one response code property must exist",
+ "patternProperties": {
+ "^[1-5](?:[0-9]{2}|XX)$": false
+ }
+ },
+ "then": {
+ "required": [
+ "default"
+ ]
+ }
+ },
+ "response": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#response-object",
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "headers": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/header-or-reference"
+ }
+ },
+ "content": {
+ "$ref": "#/$defs/content"
+ },
+ "links": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/link-or-reference"
+ }
+ }
+ },
+ "required": [
+ "description"
+ ],
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "response-or-reference": {
+ "if": {
+ "type": "object",
+ "required": [
+ "$ref"
+ ]
+ },
+ "then": {
+ "$ref": "#/$defs/reference"
+ },
+ "else": {
+ "$ref": "#/$defs/response"
+ }
+ },
+ "callbacks": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#callback-object",
+ "type": "object",
+ "$ref": "#/$defs/specification-extensions",
+ "additionalProperties": {
+ "$ref": "#/$defs/path-item"
+ }
+ },
+ "callbacks-or-reference": {
+ "if": {
+ "type": "object",
+ "required": [
+ "$ref"
+ ]
+ },
+ "then": {
+ "$ref": "#/$defs/reference"
+ },
+ "else": {
+ "$ref": "#/$defs/callbacks"
+ }
+ },
+ "example": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#example-object",
+ "type": "object",
+ "properties": {
+ "summary": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "value": true,
+ "externalValue": {
+ "type": "string",
+ "format": "uri-reference"
+ }
+ },
+ "not": {
+ "required": [
+ "value",
+ "externalValue"
+ ]
+ },
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "example-or-reference": {
+ "if": {
+ "type": "object",
+ "required": [
+ "$ref"
+ ]
+ },
+ "then": {
+ "$ref": "#/$defs/reference"
+ },
+ "else": {
+ "$ref": "#/$defs/example"
+ }
+ },
+ "link": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#link-object",
+ "type": "object",
+ "properties": {
+ "operationRef": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "operationId": {
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "#/$defs/map-of-strings"
+ },
+ "requestBody": true,
+ "description": {
+ "type": "string"
+ },
+ "server": {
+ "$ref": "#/$defs/server"
+ }
+ },
+ "oneOf": [
+ {
+ "required": [
+ "operationRef"
+ ]
+ },
+ {
+ "required": [
+ "operationId"
+ ]
+ }
+ ],
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "link-or-reference": {
+ "if": {
+ "type": "object",
+ "required": [
+ "$ref"
+ ]
+ },
+ "then": {
+ "$ref": "#/$defs/reference"
+ },
+ "else": {
+ "$ref": "#/$defs/link"
+ }
+ },
+ "header": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#header-object",
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "required": {
+ "default": false,
+ "type": "boolean"
+ },
+ "deprecated": {
+ "default": false,
+ "type": "boolean"
+ },
+ "schema": {
+ "$dynamicRef": "#meta"
+ },
+ "content": {
+ "$ref": "#/$defs/content",
+ "minProperties": 1,
+ "maxProperties": 1
+ }
+ },
+ "oneOf": [
+ {
+ "required": [
+ "schema"
+ ]
+ },
+ {
+ "required": [
+ "content"
+ ]
+ }
+ ],
+ "dependentSchemas": {
+ "schema": {
+ "properties": {
+ "style": {
+ "default": "simple",
+ "const": "simple"
+ },
+ "explode": {
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "$ref": "#/$defs/examples"
+ }
+ },
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "header-or-reference": {
+ "if": {
+ "type": "object",
+ "required": [
+ "$ref"
+ ]
+ },
+ "then": {
+ "$ref": "#/$defs/reference"
+ },
+ "else": {
+ "$ref": "#/$defs/header"
+ }
+ },
+ "tag": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#tag-object",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "externalDocs": {
+ "$ref": "#/$defs/external-documentation"
+ }
+ },
+ "required": [
+ "name"
+ ],
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "reference": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#reference-object",
+ "type": "object",
+ "properties": {
+ "$ref": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ }
+ }
+ },
+ "schema": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#schema-object",
+ "$dynamicAnchor": "meta",
+ "type": [
+ "object",
+ "boolean"
+ ]
+ },
+ "security-scheme": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#security-scheme-object",
+ "type": "object",
+ "properties": {
+ "type": {
+ "enum": [
+ "apiKey",
+ "http",
+ "mutualTLS",
+ "oauth2",
+ "openIdConnect"
+ ]
+ },
+ "description": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "type"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/$defs/specification-extensions"
+ },
+ {
+ "$ref": "#/$defs/security-scheme/$defs/type-apikey"
+ },
+ {
+ "$ref": "#/$defs/security-scheme/$defs/type-http"
+ },
+ {
+ "$ref": "#/$defs/security-scheme/$defs/type-http-bearer"
+ },
+ {
+ "$ref": "#/$defs/security-scheme/$defs/type-oauth2"
+ },
+ {
+ "$ref": "#/$defs/security-scheme/$defs/type-oidc"
+ }
+ ],
+ "unevaluatedProperties": false,
+ "$defs": {
+ "type-apikey": {
+ "if": {
+ "properties": {
+ "type": {
+ "const": "apiKey"
+ }
+ }
+ },
+ "then": {
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "in": {
+ "enum": [
+ "query",
+ "header",
+ "cookie"
+ ]
+ }
+ },
+ "required": [
+ "name",
+ "in"
+ ]
+ }
+ },
+ "type-http": {
+ "if": {
+ "properties": {
+ "type": {
+ "const": "http"
+ }
+ }
+ },
+ "then": {
+ "properties": {
+ "scheme": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "scheme"
+ ]
+ }
+ },
+ "type-http-bearer": {
+ "if": {
+ "properties": {
+ "type": {
+ "const": "http"
+ },
+ "scheme": {
+ "type": "string",
+ "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$"
+ }
+ },
+ "required": [
+ "type",
+ "scheme"
+ ]
+ },
+ "then": {
+ "properties": {
+ "bearerFormat": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "type-oauth2": {
+ "if": {
+ "properties": {
+ "type": {
+ "const": "oauth2"
+ }
+ }
+ },
+ "then": {
+ "properties": {
+ "flows": {
+ "$ref": "#/$defs/oauth-flows"
+ }
+ },
+ "required": [
+ "flows"
+ ]
+ }
+ },
+ "type-oidc": {
+ "if": {
+ "properties": {
+ "type": {
+ "const": "openIdConnect"
+ }
+ }
+ },
+ "then": {
+ "properties": {
+ "openIdConnectUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ }
+ },
+ "required": [
+ "openIdConnectUrl"
+ ]
+ }
+ }
+ }
+ },
+ "security-scheme-or-reference": {
+ "if": {
+ "type": "object",
+ "required": [
+ "$ref"
+ ]
+ },
+ "then": {
+ "$ref": "#/$defs/reference"
+ },
+ "else": {
+ "$ref": "#/$defs/security-scheme"
+ }
+ },
+ "oauth-flows": {
+ "type": "object",
+ "properties": {
+ "implicit": {
+ "$ref": "#/$defs/oauth-flows/$defs/implicit"
+ },
+ "password": {
+ "$ref": "#/$defs/oauth-flows/$defs/password"
+ },
+ "clientCredentials": {
+ "$ref": "#/$defs/oauth-flows/$defs/client-credentials"
+ },
+ "authorizationCode": {
+ "$ref": "#/$defs/oauth-flows/$defs/authorization-code"
+ }
+ },
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false,
+ "$defs": {
+ "implicit": {
+ "type": "object",
+ "properties": {
+ "authorizationUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "refreshUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "scopes": {
+ "$ref": "#/$defs/map-of-strings"
+ }
+ },
+ "required": [
+ "authorizationUrl",
+ "scopes"
+ ],
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "password": {
+ "type": "object",
+ "properties": {
+ "tokenUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "refreshUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "scopes": {
+ "$ref": "#/$defs/map-of-strings"
+ }
+ },
+ "required": [
+ "tokenUrl",
+ "scopes"
+ ],
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "client-credentials": {
+ "type": "object",
+ "properties": {
+ "tokenUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "refreshUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "scopes": {
+ "$ref": "#/$defs/map-of-strings"
+ }
+ },
+ "required": [
+ "tokenUrl",
+ "scopes"
+ ],
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ },
+ "authorization-code": {
+ "type": "object",
+ "properties": {
+ "authorizationUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "tokenUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "refreshUrl": {
+ "type": "string",
+ "format": "uri-reference"
+ },
+ "scopes": {
+ "$ref": "#/$defs/map-of-strings"
+ }
+ },
+ "required": [
+ "authorizationUrl",
+ "tokenUrl",
+ "scopes"
+ ],
+ "$ref": "#/$defs/specification-extensions",
+ "unevaluatedProperties": false
+ }
+ }
+ },
+ "security-requirement": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#security-requirement-object",
+ "type": "object",
+ "additionalProperties": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "specification-extensions": {
+ "$comment": "https://spec.openapis.org/oas/v3.1#specification-extensions",
+ "patternProperties": {
+ "^x-": {}
+ }
+ },
+ "examples": {
+ "properties": {
+ "example": true,
+ "examples": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/example-or-reference"
+ }
+ }
+ },
+ "not": {
+ "required": [
+ "example",
+ "examples"
+ ]
+ }
+ },
+ "map-of-strings": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "styles-for-form": {
+ "if": {
+ "properties": {
+ "style": {
+ "const": "form"
+ }
+ },
+ "required": [
+ "style"
+ ]
+ },
+ "then": {
+ "properties": {
+ "explode": {
+ "default": true
+ }
+ }
+ },
+ "else": {
+ "properties": {
+ "explode": {
+ "default": false
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/ApiRequestBuilder.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/ApiRequestBuilder.verified.cs
new file mode 100644
index 0000000000..3089b919fb
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/ApiRequestBuilder.verified.cs
@@ -0,0 +1,41 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System;
+using TodoApp.Client.Api.Items;
+namespace TodoApp.Client.Api
+{
+ ///
+ /// Builds and executes requests for operations under \api
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class ApiRequestBuilder : BaseRequestBuilder
+ {
+ /// The items property
+ public global::TodoApp.Client.Api.Items.ItemsRequestBuilder Items
+ {
+ get => new global::TodoApp.Client.Api.Items.ItemsRequestBuilder(PathParameters, RequestAdapter);
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public ApiRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public ApiRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api", rawUrl)
+ {
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/Find/FindRequestBuilder.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/Find/FindRequestBuilder.verified.cs
new file mode 100644
index 0000000000..1e6da55fa3
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/Find/FindRequestBuilder.verified.cs
@@ -0,0 +1,94 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+using TodoApp.Client.Models;
+namespace TodoApp.Client.Api.Items.Find
+{
+ ///
+ /// Builds and executes requests for operations under \api\items\find
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class FindRequestBuilder : BaseRequestBuilder
+ {
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public FindRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/find?IsCompleted={IsCompleted}&Text={Text}", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public FindRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/find?IsCompleted={IsCompleted}&Text={Text}", rawUrl)
+ {
+ }
+ /// A
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ var requestInfo = ToGetRequestInformation(requestConfiguration);
+ return await RequestAdapter.SendAsync(requestInfo, global::TodoApp.Client.Models.TodoListViewModel.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false);
+ }
+ /// A
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default)
+ {
+#endif
+ var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/json");
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::TodoApp.Client.Api.Items.Find.FindRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::TodoApp.Client.Api.Items.Find.FindRequestBuilder(rawUrl, RequestAdapter);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ #pragma warning disable CS1591
+ public partial class FindRequestBuilderGetQueryParameters
+ #pragma warning restore CS1591
+ {
+ /// Gets or sets a value indicating whether to search completed Todo items.
+ public bool? IsCompleted { get; set; }
+ /// Gets or sets the text of the filter.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Text { get; set; }
+#nullable restore
+#else
+ public string Text { get; set; }
+#endif
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/GetAfter/GetAfterRequestBuilder.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/GetAfter/GetAfterRequestBuilder.verified.cs
new file mode 100644
index 0000000000..d420636015
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/GetAfter/GetAfterRequestBuilder.verified.cs
@@ -0,0 +1,86 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+using TodoApp.Client.Models;
+namespace TodoApp.Client.Api.Items.GetAfter
+{
+ ///
+ /// Builds and executes requests for operations under \api\items\getAfter
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class GetAfterRequestBuilder : BaseRequestBuilder
+ {
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public GetAfterRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/getAfter?value={value}", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public GetAfterRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/getAfter?value={value}", rawUrl)
+ {
+ }
+ /// A
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ var requestInfo = ToGetRequestInformation(requestConfiguration);
+ return await RequestAdapter.SendAsync(requestInfo, global::TodoApp.Client.Models.TodoListViewModel.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false);
+ }
+ /// A
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default)
+ {
+#endif
+ var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/json");
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::TodoApp.Client.Api.Items.GetAfter.GetAfterRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::TodoApp.Client.Api.Items.GetAfter.GetAfterRequestBuilder(rawUrl, RequestAdapter);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ #pragma warning disable CS1591
+ public partial class GetAfterRequestBuilderGetQueryParameters
+ #pragma warning restore CS1591
+ {
+ [QueryParameter("value")]
+ public DateTimeOffset? Value { get; set; }
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/Item/Complete/CompleteRequestBuilder.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/Item/Complete/CompleteRequestBuilder.verified.cs
new file mode 100644
index 0000000000..09e8901d32
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/Item/Complete/CompleteRequestBuilder.verified.cs
@@ -0,0 +1,90 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+using TodoApp.Client.Models;
+namespace TodoApp.Client.Api.Items.Item.Complete
+{
+ ///
+ /// Builds and executes requests for operations under \api\items\{id}\complete
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class CompleteRequestBuilder : BaseRequestBuilder
+ {
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public CompleteRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/{id}/complete", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public CompleteRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/{id}/complete", rawUrl)
+ {
+ }
+ ///
+ /// Marks the todo item with the specified ID as complete.
+ ///
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ /// When receiving a 400 status code
+ /// When receiving a 404 status code
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PostAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task PostAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ var requestInfo = ToPostRequestInformation(requestConfiguration);
+ var errorMapping = new Dictionary>
+ {
+ { "400", global::TodoApp.Client.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ { "404", global::TodoApp.Client.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ };
+ await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
+ }
+ ///
+ /// Marks the todo item with the specified ID as complete.
+ ///
+ /// A
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPostRequestInformation(Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToPostRequestInformation(Action> requestConfiguration = default)
+ {
+#endif
+ var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/problem+json");
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::TodoApp.Client.Api.Items.Item.Complete.CompleteRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::TodoApp.Client.Api.Items.Item.Complete.CompleteRequestBuilder(rawUrl, RequestAdapter);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/Item/ItemsItemRequestBuilder.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/Item/ItemsItemRequestBuilder.verified.cs
new file mode 100644
index 0000000000..e3acec88bd
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/Item/ItemsItemRequestBuilder.verified.cs
@@ -0,0 +1,142 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+using TodoApp.Client.Api.Items.Item.Complete;
+using TodoApp.Client.Api.Items.Item.Priority;
+using TodoApp.Client.Models;
+namespace TodoApp.Client.Api.Items.Item
+{
+ ///
+ /// Builds and executes requests for operations under \api\items\{id}
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class ItemsItemRequestBuilder : BaseRequestBuilder
+ {
+ /// The complete property
+ public global::TodoApp.Client.Api.Items.Item.Complete.CompleteRequestBuilder Complete
+ {
+ get => new global::TodoApp.Client.Api.Items.Item.Complete.CompleteRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// The priority property
+ public global::TodoApp.Client.Api.Items.Item.Priority.PriorityRequestBuilder Priority
+ {
+ get => new global::TodoApp.Client.Api.Items.Item.Priority.PriorityRequestBuilder(PathParameters, RequestAdapter);
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public ItemsItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/{id}", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public ItemsItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/{id}", rawUrl)
+ {
+ }
+ ///
+ /// Deletes the todo item with the specified ID.
+ ///
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ /// When receiving a 404 status code
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task DeleteAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task DeleteAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ var requestInfo = ToDeleteRequestInformation(requestConfiguration);
+ var errorMapping = new Dictionary>
+ {
+ { "404", global::TodoApp.Client.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ };
+ await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
+ }
+ ///
+ /// Gets the todo item with the specified ID.
+ ///
+ /// A
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ /// When receiving a 404 status code
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ var requestInfo = ToGetRequestInformation(requestConfiguration);
+ var errorMapping = new Dictionary>
+ {
+ { "404", global::TodoApp.Client.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ };
+ return await RequestAdapter.SendAsync(requestInfo, global::TodoApp.Client.Models.TodoItemModel.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
+ }
+ ///
+ /// Deletes the todo item with the specified ID.
+ ///
+ /// A
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToDeleteRequestInformation(Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToDeleteRequestInformation(Action> requestConfiguration = default)
+ {
+#endif
+ var requestInfo = new RequestInformation(Method.DELETE, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/problem+json");
+ return requestInfo;
+ }
+ ///
+ /// Gets the todo item with the specified ID.
+ ///
+ /// A
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default)
+ {
+#endif
+ var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/json");
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::TodoApp.Client.Api.Items.Item.ItemsItemRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::TodoApp.Client.Api.Items.Item.ItemsItemRequestBuilder(rawUrl, RequestAdapter);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/Item/Priority/PriorityRequestBuilder.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/Item/Priority/PriorityRequestBuilder.verified.cs
new file mode 100644
index 0000000000..6df4f2ccf7
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/Item/Priority/PriorityRequestBuilder.verified.cs
@@ -0,0 +1,95 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+using TodoApp.Client.Models;
+namespace TodoApp.Client.Api.Items.Item.Priority
+{
+ ///
+ /// Builds and executes requests for operations under \api\items\{id}\priority
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class PriorityRequestBuilder : BaseRequestBuilder
+ {
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public PriorityRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/{id}/priority", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public PriorityRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items/{id}/priority", rawUrl)
+ {
+ }
+ ///
+ /// Updates the priority of the todo item with the specified ID to the specified priority.
+ ///
+ /// Represents the model for updating the priority of a Todo item.
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ /// When receiving a 400 status code
+ /// When receiving a 404 status code
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PatchAsync(global::TodoApp.Client.Models.UpdateTodoItemPriorityModel body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task PatchAsync(global::TodoApp.Client.Models.UpdateTodoItemPriorityModel body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
+ var requestInfo = ToPatchRequestInformation(body, requestConfiguration);
+ var errorMapping = new Dictionary>
+ {
+ { "400", global::TodoApp.Client.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ { "404", global::TodoApp.Client.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ };
+ await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false);
+ }
+ ///
+ /// Updates the priority of the todo item with the specified ID to the specified priority.
+ ///
+ /// A
+ /// Represents the model for updating the priority of a Todo item.
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPatchRequestInformation(global::TodoApp.Client.Models.UpdateTodoItemPriorityModel body, Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToPatchRequestInformation(global::TodoApp.Client.Models.UpdateTodoItemPriorityModel body, Action> requestConfiguration = default)
+ {
+#endif
+ if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
+ var requestInfo = new RequestInformation(Method.PATCH, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/problem+json");
+ requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::TodoApp.Client.Api.Items.Item.Priority.PriorityRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::TodoApp.Client.Api.Items.Item.Priority.PriorityRequestBuilder(rawUrl, RequestAdapter);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/ItemsRequestBuilder.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/ItemsRequestBuilder.verified.cs
new file mode 100644
index 0000000000..af6df99c5b
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Api/Items/ItemsRequestBuilder.verified.cs
@@ -0,0 +1,156 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+using TodoApp.Client.Api.Items.Find;
+using TodoApp.Client.Api.Items.GetAfter;
+using TodoApp.Client.Api.Items.Item;
+using TodoApp.Client.Models;
+namespace TodoApp.Client.Api.Items
+{
+ ///
+ /// Builds and executes requests for operations under \api\items
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class ItemsRequestBuilder : BaseRequestBuilder
+ {
+ /// The find property
+ public global::TodoApp.Client.Api.Items.Find.FindRequestBuilder Find
+ {
+ get => new global::TodoApp.Client.Api.Items.Find.FindRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// The getAfter property
+ public global::TodoApp.Client.Api.Items.GetAfter.GetAfterRequestBuilder GetAfter
+ {
+ get => new global::TodoApp.Client.Api.Items.GetAfter.GetAfterRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// Gets an item from the TodoApp.Client.api.items.item collection
+ /// The Todo item's ID.
+ /// A
+ public global::TodoApp.Client.Api.Items.Item.ItemsItemRequestBuilder this[Guid position]
+ {
+ get
+ {
+ var urlTplParams = new Dictionary(PathParameters);
+ urlTplParams.Add("id", position);
+ return new global::TodoApp.Client.Api.Items.Item.ItemsItemRequestBuilder(urlTplParams, RequestAdapter);
+ }
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public ItemsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public ItemsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/api/items", rawUrl)
+ {
+ }
+ ///
+ /// Gets all of the current user's todo items.
+ ///
+ /// A
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ var requestInfo = ToGetRequestInformation(requestConfiguration);
+ return await RequestAdapter.SendAsync(requestInfo, global::TodoApp.Client.Models.TodoListViewModel.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false);
+ }
+ ///
+ /// Creates a new todo item for the current user and returns its ID.
+ ///
+ /// A
+ /// Represents the model for creating a new Todo item.
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ /// When receiving a 400 status code
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PostAsync(global::TodoApp.Client.Models.CreateTodoItemModel body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task PostAsync(global::TodoApp.Client.Models.CreateTodoItemModel body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
+ var requestInfo = ToPostRequestInformation(body, requestConfiguration);
+ var errorMapping = new Dictionary>
+ {
+ { "400", global::TodoApp.Client.Models.ProblemDetails.CreateFromDiscriminatorValue },
+ };
+ return await RequestAdapter.SendAsync(requestInfo, global::TodoApp.Client.Models.CreatedTodoItemModel.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false);
+ }
+ ///
+ /// Gets all of the current user's todo items.
+ ///
+ /// A
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default)
+ {
+#endif
+ var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/json");
+ return requestInfo;
+ }
+ ///
+ /// Creates a new todo item for the current user and returns its ID.
+ ///
+ /// A
+ /// Represents the model for creating a new Todo item.
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPostRequestInformation(global::TodoApp.Client.Models.CreateTodoItemModel body, Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToPostRequestInformation(global::TodoApp.Client.Models.CreateTodoItemModel body, Action> requestConfiguration = default)
+ {
+#endif
+ if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
+ var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/json");
+ requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::TodoApp.Client.Api.Items.ItemsRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::TodoApp.Client.Api.Items.ItemsRequestBuilder(rawUrl, RequestAdapter);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/CreateTodoItemModel.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/CreateTodoItemModel.verified.cs
new file mode 100644
index 0000000000..facd4f1345
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/CreateTodoItemModel.verified.cs
@@ -0,0 +1,56 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System.Collections.Generic;
+using System.IO;
+using System;
+namespace TodoApp.Client.Models
+{
+ ///
+ /// Represents the model for creating a new Todo item.
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class CreateTodoItemModel : IParsable
+ {
+ /// Gets or sets the text of the Todo item.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Text { get; set; }
+#nullable restore
+#else
+ public string Text { get; set; }
+#endif
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// A
+ /// The parse node to use to read the discriminator value and create the object
+ public static global::TodoApp.Client.Models.CreateTodoItemModel CreateFromDiscriminatorValue(IParseNode parseNode)
+ {
+ if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
+ return new global::TodoApp.Client.Models.CreateTodoItemModel();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ /// A IDictionary<string, Action<IParseNode>>
+ public virtual IDictionary> GetFieldDeserializers()
+ {
+ return new Dictionary>
+ {
+ { "text", n => { Text = n.GetStringValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public virtual void Serialize(ISerializationWriter writer)
+ {
+ if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
+ writer.WriteStringValue("text", Text);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/CreatedTodoItemModel.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/CreatedTodoItemModel.verified.cs
new file mode 100644
index 0000000000..ab6ca282e9
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/CreatedTodoItemModel.verified.cs
@@ -0,0 +1,56 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System.Collections.Generic;
+using System.IO;
+using System;
+namespace TodoApp.Client.Models
+{
+ ///
+ /// Represents the model for a created Todo item.
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class CreatedTodoItemModel : IParsable
+ {
+ /// Gets or sets the ID of the created Todo item.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Id { get; set; }
+#nullable restore
+#else
+ public string Id { get; set; }
+#endif
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// A
+ /// The parse node to use to read the discriminator value and create the object
+ public static global::TodoApp.Client.Models.CreatedTodoItemModel CreateFromDiscriminatorValue(IParseNode parseNode)
+ {
+ if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
+ return new global::TodoApp.Client.Models.CreatedTodoItemModel();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ /// A IDictionary<string, Action<IParseNode>>
+ public virtual IDictionary> GetFieldDeserializers()
+ {
+ return new Dictionary>
+ {
+ { "id", n => { Id = n.GetStringValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public virtual void Serialize(ISerializationWriter writer)
+ {
+ if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
+ writer.WriteStringValue("id", Id);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/ProblemDetails.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/ProblemDetails.verified.cs
new file mode 100644
index 0000000000..1773cc90ee
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/ProblemDetails.verified.cs
@@ -0,0 +1,92 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System;
+namespace TodoApp.Client.Models
+{
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ #pragma warning disable CS1591
+ public partial class ProblemDetails : ApiException, IParsable
+ #pragma warning restore CS1591
+ {
+ /// The detail property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Detail { get; set; }
+#nullable restore
+#else
+ public string Detail { get; set; }
+#endif
+ /// The instance property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Instance { get; set; }
+#nullable restore
+#else
+ public string Instance { get; set; }
+#endif
+ /// The primary error message.
+ public override string Message { get => base.Message; }
+ /// The status property
+ public int? Status { get; set; }
+ /// The title property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Title { get; set; }
+#nullable restore
+#else
+ public string Title { get; set; }
+#endif
+ /// The type property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Type { get; set; }
+#nullable restore
+#else
+ public string Type { get; set; }
+#endif
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// A
+ /// The parse node to use to read the discriminator value and create the object
+ public static global::TodoApp.Client.Models.ProblemDetails CreateFromDiscriminatorValue(IParseNode parseNode)
+ {
+ if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
+ return new global::TodoApp.Client.Models.ProblemDetails();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ /// A IDictionary<string, Action<IParseNode>>
+ public virtual IDictionary> GetFieldDeserializers()
+ {
+ return new Dictionary>
+ {
+ { "detail", n => { Detail = n.GetStringValue(); } },
+ { "instance", n => { Instance = n.GetStringValue(); } },
+ { "status", n => { Status = n.GetIntValue(); } },
+ { "title", n => { Title = n.GetStringValue(); } },
+ { "type", n => { Type = n.GetStringValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public virtual void Serialize(ISerializationWriter writer)
+ {
+ if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
+ writer.WriteStringValue("detail", Detail);
+ writer.WriteStringValue("instance", Instance);
+ writer.WriteIntValue("status", Status);
+ writer.WriteStringValue("title", Title);
+ writer.WriteStringValue("type", Type);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/TodoItemModel.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/TodoItemModel.verified.cs
new file mode 100644
index 0000000000..f9e6233aca
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/TodoItemModel.verified.cs
@@ -0,0 +1,82 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System.Collections.Generic;
+using System.IO;
+using System;
+namespace TodoApp.Client.Models
+{
+ ///
+ /// Represents a Todo item.
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class TodoItemModel : IParsable
+ {
+ /// Gets or sets the date and time the item was completed.
+ public DateTimeOffset? CompletedAt { get; set; }
+ /// Gets or sets the date and time the item was created.
+ public DateTimeOffset? CreatedAt { get; set; }
+ /// Gets or sets the ID of the Todo item.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Id { get; set; }
+#nullable restore
+#else
+ public string Id { get; set; }
+#endif
+ /// Gets or sets the date and time the Todo item was last updated.
+ public DateTimeOffset? LastUpdated { get; set; }
+ /// Gets or sets the optional priority of the Todo item.
+ public global::TodoApp.Client.Models.TodoPriority? Priority { get; set; }
+ /// Gets or sets the text of the Todo item.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Text { get; set; }
+#nullable restore
+#else
+ public string Text { get; set; }
+#endif
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// A
+ /// The parse node to use to read the discriminator value and create the object
+ public static global::TodoApp.Client.Models.TodoItemModel CreateFromDiscriminatorValue(IParseNode parseNode)
+ {
+ if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
+ return new global::TodoApp.Client.Models.TodoItemModel();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ /// A IDictionary<string, Action<IParseNode>>
+ public virtual IDictionary> GetFieldDeserializers()
+ {
+ return new Dictionary>
+ {
+ { "completedAt", n => { CompletedAt = n.GetDateTimeOffsetValue(); } },
+ { "createdAt", n => { CreatedAt = n.GetDateTimeOffsetValue(); } },
+ { "id", n => { Id = n.GetStringValue(); } },
+ { "lastUpdated", n => { LastUpdated = n.GetDateTimeOffsetValue(); } },
+ { "priority", n => { Priority = n.GetEnumValue(); } },
+ { "text", n => { Text = n.GetStringValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public virtual void Serialize(ISerializationWriter writer)
+ {
+ if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
+ writer.WriteDateTimeOffsetValue("completedAt", CompletedAt);
+ writer.WriteDateTimeOffsetValue("createdAt", CreatedAt);
+ writer.WriteStringValue("id", Id);
+ writer.WriteDateTimeOffsetValue("lastUpdated", LastUpdated);
+ writer.WriteEnumValue("priority", Priority);
+ writer.WriteStringValue("text", Text);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/TodoListViewModel.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/TodoListViewModel.verified.cs
new file mode 100644
index 0000000000..eb520f51c2
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/TodoListViewModel.verified.cs
@@ -0,0 +1,56 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System.Collections.Generic;
+using System.IO;
+using System;
+namespace TodoApp.Client.Models
+{
+ ///
+ /// Represents a collection of Todo items.
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class TodoListViewModel : IParsable
+ {
+ /// Gets or sets the Todo item(s).
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public List? Items { get; set; }
+#nullable restore
+#else
+ public List Items { get; set; }
+#endif
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// A
+ /// The parse node to use to read the discriminator value and create the object
+ public static global::TodoApp.Client.Models.TodoListViewModel CreateFromDiscriminatorValue(IParseNode parseNode)
+ {
+ if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
+ return new global::TodoApp.Client.Models.TodoListViewModel();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ /// A IDictionary<string, Action<IParseNode>>
+ public virtual IDictionary> GetFieldDeserializers()
+ {
+ return new Dictionary>
+ {
+ { "items", n => { Items = n.GetCollectionOfObjectValues(global::TodoApp.Client.Models.TodoItemModel.CreateFromDiscriminatorValue)?.AsList(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public virtual void Serialize(ISerializationWriter writer)
+ {
+ if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
+ writer.WriteCollectionOfObjectValues("items", Items);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/TodoPriority.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/TodoPriority.verified.cs
new file mode 100644
index 0000000000..3ff868a37c
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/TodoPriority.verified.cs
@@ -0,0 +1,23 @@
+//
+using System.Runtime.Serialization;
+using System;
+namespace TodoApp.Client.Models
+{
+ /// The priority levels for a Todo item.
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public enum TodoPriority
+ {
+ [EnumMember(Value = "Normal")]
+ #pragma warning disable CS1591
+ Normal,
+ #pragma warning restore CS1591
+ [EnumMember(Value = "Low")]
+ #pragma warning disable CS1591
+ Low,
+ #pragma warning restore CS1591
+ [EnumMember(Value = "High")]
+ #pragma warning disable CS1591
+ High,
+ #pragma warning restore CS1591
+ }
+}
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/UpdateTodoItemPriorityModel.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/UpdateTodoItemPriorityModel.verified.cs
new file mode 100644
index 0000000000..7febaace2e
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/Models/UpdateTodoItemPriorityModel.verified.cs
@@ -0,0 +1,50 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System.Collections.Generic;
+using System.IO;
+using System;
+namespace TodoApp.Client.Models
+{
+ ///
+ /// Represents the model for updating the priority of a Todo item.
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class UpdateTodoItemPriorityModel : IParsable
+ {
+ /// Gets or sets the new priority of the Todo item.
+ public global::TodoApp.Client.Models.TodoPriority? Priority { get; set; }
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// A
+ /// The parse node to use to read the discriminator value and create the object
+ public static global::TodoApp.Client.Models.UpdateTodoItemPriorityModel CreateFromDiscriminatorValue(IParseNode parseNode)
+ {
+ if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
+ return new global::TodoApp.Client.Models.UpdateTodoItemPriorityModel();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ /// A IDictionary<string, Action<IParseNode>>
+ public virtual IDictionary> GetFieldDeserializers()
+ {
+ return new Dictionary>
+ {
+ { "priority", n => { Priority = n.GetEnumValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public virtual void Serialize(ISerializationWriter writer)
+ {
+ if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
+ writer.WriteEnumValue("priority", Priority);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/TodoApiClient.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/TodoApiClient.verified.cs
new file mode 100644
index 0000000000..a78b7241a4
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/CodeGenerationTests.VerifyKiotaTodoAppClient/TodoApiClient.verified.cs
@@ -0,0 +1,43 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions;
+using Microsoft.Kiota.Serialization.Form;
+using Microsoft.Kiota.Serialization.Json;
+using Microsoft.Kiota.Serialization.Multipart;
+using Microsoft.Kiota.Serialization.Text;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System;
+using TodoApp.Client.Api;
+namespace TodoApp.Client
+{
+ ///
+ /// The main entry point of the SDK, exposes the configuration and the fluent API.
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class TodoApiClient : BaseRequestBuilder
+ {
+ /// The api property
+ public global::TodoApp.Client.Api.ApiRequestBuilder Api
+ {
+ get => new global::TodoApp.Client.Api.ApiRequestBuilder(PathParameters, RequestAdapter);
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The request adapter to use to execute the requests.
+ public TodoApiClient(IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}", new Dictionary())
+ {
+ ApiClientBuilder.RegisterDefaultSerializer();
+ ApiClientBuilder.RegisterDefaultSerializer();
+ ApiClientBuilder.RegisterDefaultSerializer();
+ ApiClientBuilder.RegisterDefaultSerializer();
+ ApiClientBuilder.RegisterDefaultDeserializer();
+ ApiClientBuilder.RegisterDefaultDeserializer();
+ ApiClientBuilder.RegisterDefaultDeserializer();
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_0452f380fe4cda4f/KiotaOpenApiClient.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_0452f380fe4cda4f/KiotaOpenApiClient.verified.cs
new file mode 100644
index 0000000000..32c694c3e9
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_0452f380fe4cda4f/KiotaOpenApiClient.verified.cs
@@ -0,0 +1,43 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions;
+using Microsoft.Kiota.Serialization.Form;
+using Microsoft.Kiota.Serialization.Json;
+using Microsoft.Kiota.Serialization.Multipart;
+using Microsoft.Kiota.Serialization.Text;
+using Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Products;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System;
+namespace Swashbuckle.AspNetCore.IntegrationTests.KiotaTests
+{
+ ///
+ /// The main entry point of the SDK, exposes the configuration and the fluent API.
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class KiotaOpenApiClient : BaseRequestBuilder
+ {
+ /// The products property
+ public global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Products.ProductsRequestBuilder Products
+ {
+ get => new global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Products.ProductsRequestBuilder(PathParameters, RequestAdapter);
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The request adapter to use to execute the requests.
+ public KiotaOpenApiClient(IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}", new Dictionary())
+ {
+ ApiClientBuilder.RegisterDefaultSerializer();
+ ApiClientBuilder.RegisterDefaultSerializer();
+ ApiClientBuilder.RegisterDefaultSerializer();
+ ApiClientBuilder.RegisterDefaultSerializer();
+ ApiClientBuilder.RegisterDefaultDeserializer();
+ ApiClientBuilder.RegisterDefaultDeserializer();
+ ApiClientBuilder.RegisterDefaultDeserializer();
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_0452f380fe4cda4f/Models/Product.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_0452f380fe4cda4f/Models/Product.verified.cs
new file mode 100644
index 0000000000..97de045e50
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_0452f380fe4cda4f/Models/Product.verified.cs
@@ -0,0 +1,59 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using System.Collections.Generic;
+using System.IO;
+using System;
+namespace Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Models
+{
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ #pragma warning disable CS1591
+ public partial class Product : IParsable
+ #pragma warning restore CS1591
+ {
+ /// The description property
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public string? Description { get; set; }
+#nullable restore
+#else
+ public string Description { get; set; }
+#endif
+ /// The id property
+ public int? Id { get; set; }
+ ///
+ /// Creates a new instance of the appropriate class based on discriminator value
+ ///
+ /// A
+ /// The parse node to use to read the discriminator value and create the object
+ public static global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Models.Product CreateFromDiscriminatorValue(IParseNode parseNode)
+ {
+ if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode));
+ return new global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Models.Product();
+ }
+ ///
+ /// The deserialization information for the current model
+ ///
+ /// A IDictionary<string, Action<IParseNode>>
+ public virtual IDictionary> GetFieldDeserializers()
+ {
+ return new Dictionary>
+ {
+ { "description", n => { Description = n.GetStringValue(); } },
+ { "id", n => { Id = n.GetIntValue(); } },
+ };
+ }
+ ///
+ /// Serializes information the current object
+ ///
+ /// Serialization writer to use to serialize this model
+ public virtual void Serialize(ISerializationWriter writer)
+ {
+ if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer));
+ writer.WriteStringValue("description", Description);
+ writer.WriteIntValue("id", Id);
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_0452f380fe4cda4f/Products/ProductsRequestBuilder.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_0452f380fe4cda4f/Products/ProductsRequestBuilder.verified.cs
new file mode 100644
index 0000000000..e77961fa65
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_0452f380fe4cda4f/Products/ProductsRequestBuilder.verified.cs
@@ -0,0 +1,87 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Models;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+namespace Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Products
+{
+ ///
+ /// Builds and executes requests for operations under \products
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class ProductsRequestBuilder : BaseRequestBuilder
+ {
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public ProductsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/products", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public ProductsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/products", rawUrl)
+ {
+ }
+ /// A List<global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Models.Product>
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task?> GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task> GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ var requestInfo = ToGetRequestInformation(requestConfiguration);
+ var collectionResult = await RequestAdapter.SendCollectionAsync(requestInfo, global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Models.Product.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false);
+ return collectionResult?.AsList();
+ }
+ /// A
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default)
+ {
+#endif
+ var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/json");
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Products.ProductsRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Products.ProductsRequestBuilder(rawUrl, RequestAdapter);
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")]
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class ProductsRequestBuilderGetRequestConfiguration : RequestConfiguration
+ {
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/AnnotationsRequestBuilder.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/AnnotationsRequestBuilder.verified.cs
new file mode 100644
index 0000000000..73d841b894
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/AnnotationsRequestBuilder.verified.cs
@@ -0,0 +1,77 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions;
+using Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.AsParameters;
+using Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.Fruit;
+using Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.IFromFileAndEnum;
+using Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.IFromFileAndString;
+using Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.IFromObjectAndString;
+using Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.MultipleForms;
+using Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.SingleForm;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System;
+namespace Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations
+{
+ ///
+ /// Builds and executes requests for operations under \annotations
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class AnnotationsRequestBuilder : BaseRequestBuilder
+ {
+ /// The AsParameters property
+ public global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.AsParameters.AsParametersRequestBuilder AsParameters
+ {
+ get => new global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.AsParameters.AsParametersRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// The fruit property
+ public global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.Fruit.FruitRequestBuilder Fruit
+ {
+ get => new global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.Fruit.FruitRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// The IFromFileAndEnum property
+ public global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.IFromFileAndEnum.IFromFileAndEnumRequestBuilder IFromFileAndEnum
+ {
+ get => new global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.IFromFileAndEnum.IFromFileAndEnumRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// The IFromFileAndString property
+ public global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.IFromFileAndString.IFromFileAndStringRequestBuilder IFromFileAndString
+ {
+ get => new global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.IFromFileAndString.IFromFileAndStringRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// The IFromObjectAndString property
+ public global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.IFromObjectAndString.IFromObjectAndStringRequestBuilder IFromObjectAndString
+ {
+ get => new global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.IFromObjectAndString.IFromObjectAndStringRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// The multipleForms property
+ public global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.MultipleForms.MultipleFormsRequestBuilder MultipleForms
+ {
+ get => new global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.MultipleForms.MultipleFormsRequestBuilder(PathParameters, RequestAdapter);
+ }
+ /// The singleForm property
+ public global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.SingleForm.SingleFormRequestBuilder SingleForm
+ {
+ get => new global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.SingleForm.SingleFormRequestBuilder(PathParameters, RequestAdapter);
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public AnnotationsRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/annotations", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public AnnotationsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/annotations", rawUrl)
+ {
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/AsParameters/AsParametersRequestBuilder.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/AsParameters/AsParametersRequestBuilder.verified.cs
new file mode 100644
index 0000000000..c314460094
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/AsParameters/AsParametersRequestBuilder.verified.cs
@@ -0,0 +1,117 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Models;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+namespace Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.AsParameters
+{
+ ///
+ /// Builds and executes requests for operations under \annotations\AsParameters
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class AsParametersRequestBuilder : BaseRequestBuilder
+ {
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public AsParametersRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/annotations/AsParameters?paramEight={paramEight}¶mFour={paramFour}¶mSix={paramSix}¶mTen={paramTen}¶mTwelve={paramTwelve}¶mTwo={paramTwo}{¶mEleven*,paramFive*,paramNine*,paramOne*,paramSeven*,paramThree*}", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public AsParametersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/annotations/AsParameters?paramEight={paramEight}¶mFour={paramFour}¶mSix={paramSix}¶mTen={paramTen}¶mTwelve={paramTwelve}¶mTwo={paramTwo}{¶mEleven*,paramFive*,paramNine*,paramOne*,paramSeven*,paramThree*}", rawUrl)
+ {
+ }
+ /// A
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ var requestInfo = ToGetRequestInformation(requestConfiguration);
+ return await RequestAdapter.SendAsync(requestInfo, global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Models.AsParametersRecord.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false);
+ }
+ /// A
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default)
+ {
+#endif
+ var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/json");
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.AsParameters.AsParametersRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.AsParameters.AsParametersRequestBuilder(rawUrl, RequestAdapter);
+ }
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ #pragma warning disable CS1591
+ public partial class AsParametersRequestBuilderGetQueryParameters
+ #pragma warning restore CS1591
+ {
+ [QueryParameter("paramEight")]
+ public Time? ParamEight { get; set; }
+ [QueryParameter("paramEleven")]
+ public double? ParamEleven { get; set; }
+ [QueryParameter("paramFive")]
+ public Date? ParamFive { get; set; }
+ [QueryParameter("paramFour")]
+ public DateTimeOffset? ParamFour { get; set; }
+ [QueryParameter("paramNine")]
+ public int? ParamNine { get; set; }
+ /// Description
+ [QueryParameter("paramOne")]
+ public Guid? ParamOne { get; set; }
+ [QueryParameter("paramSeven")]
+ public Time? ParamSeven { get; set; }
+ [QueryParameter("paramSix")]
+ public Date? ParamSix { get; set; }
+ [QueryParameter("paramTen")]
+ public int? ParamTen { get; set; }
+ [QueryParameter("paramThree")]
+ public DateTimeOffset? ParamThree { get; set; }
+ [QueryParameter("paramTwelve")]
+ public double? ParamTwelve { get; set; }
+ [QueryParameter("paramTwo")]
+ public Guid? ParamTwo { get; set; }
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")]
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class AsParametersRequestBuilderGetRequestConfiguration : RequestConfiguration
+ {
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/Fruit/FruitRequestBuilder.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/Fruit/FruitRequestBuilder.verified.cs
new file mode 100644
index 0000000000..1f743a2e89
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/Fruit/FruitRequestBuilder.verified.cs
@@ -0,0 +1,48 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions;
+using Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.Fruit.Item;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System;
+namespace Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.Fruit
+{
+ ///
+ /// Builds and executes requests for operations under \annotations\fruit
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class FruitRequestBuilder : BaseRequestBuilder
+ {
+ /// Gets an item from the Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.annotations.fruit.item collection
+ /// The id of the fruit that will be created
+ /// A
+ public global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.Fruit.Item.FruitItemRequestBuilder this[string position]
+ {
+ get
+ {
+ var urlTplParams = new Dictionary(PathParameters);
+ urlTplParams.Add("id", position);
+ return new global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.Fruit.Item.FruitItemRequestBuilder(urlTplParams, RequestAdapter);
+ }
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public FruitRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/annotations/fruit", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public FruitRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/annotations/fruit", rawUrl)
+ {
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/Fruit/Item/FruitItemRequestBuilder.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/Fruit/Item/FruitItemRequestBuilder.verified.cs
new file mode 100644
index 0000000000..2408b0a15d
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/Fruit/Item/FruitItemRequestBuilder.verified.cs
@@ -0,0 +1,97 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Models;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+namespace Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.Fruit.Item
+{
+ ///
+ /// Builds and executes requests for operations under \annotations\fruit\{id}
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class FruitItemRequestBuilder : BaseRequestBuilder
+ {
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public FruitItemRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/annotations/fruit/{id}", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public FruitItemRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/annotations/fruit/{id}", rawUrl)
+ {
+ }
+ ///
+ /// Create a fruit
+ ///
+ /// A
+ /// Description for Schema
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PostAsync(global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Models.Fruit body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task PostAsync(global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Models.Fruit body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
+ var requestInfo = ToPostRequestInformation(body, requestConfiguration);
+ return await RequestAdapter.SendAsync(requestInfo, global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Models.Fruit.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false);
+ }
+ ///
+ /// Create a fruit
+ ///
+ /// A
+ /// Description for Schema
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPostRequestInformation(global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Models.Fruit body, Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToPostRequestInformation(global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Models.Fruit body, Action> requestConfiguration = default)
+ {
+#endif
+ if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
+ var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "application/json");
+ requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.Fruit.Item.FruitItemRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.Fruit.Item.FruitItemRequestBuilder(rawUrl, RequestAdapter);
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")]
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class FruitItemRequestBuilderPostRequestConfiguration : RequestConfiguration
+ {
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/IFromFileAndEnum/IFromFileAndEnumRequestBuilder.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/IFromFileAndEnum/IFromFileAndEnumRequestBuilder.verified.cs
new file mode 100644
index 0000000000..72889a4a75
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/IFromFileAndEnum/IFromFileAndEnumRequestBuilder.verified.cs
@@ -0,0 +1,90 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+namespace Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.IFromFileAndEnum
+{
+ ///
+ /// Builds and executes requests for operations under \annotations\IFromFileAndEnum
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class IFromFileAndEnumRequestBuilder : BaseRequestBuilder
+ {
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public IFromFileAndEnumRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/annotations/IFromFileAndEnum", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public IFromFileAndEnumRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/annotations/IFromFileAndEnum", rawUrl)
+ {
+ }
+ /// A
+ /// The request body
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PostAsync(MultipartBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task PostAsync(MultipartBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
+ var requestInfo = ToPostRequestInformation(body, requestConfiguration);
+ return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false);
+ }
+ /// A
+ /// The request body
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPostRequestInformation(MultipartBody body, Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToPostRequestInformation(MultipartBody body, Action> requestConfiguration = default)
+ {
+#endif
+ if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
+ var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9");
+ requestInfo.SetContentFromParsable(RequestAdapter, "multipart/form-data", body);
+ return requestInfo;
+ }
+ ///
+ /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
+ ///
+ /// A
+ /// The raw URL to use for the request builder.
+ public global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.IFromFileAndEnum.IFromFileAndEnumRequestBuilder WithUrl(string rawUrl)
+ {
+ return new global::Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.IFromFileAndEnum.IFromFileAndEnumRequestBuilder(rawUrl, RequestAdapter);
+ }
+ ///
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+ ///
+ [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")]
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class IFromFileAndEnumRequestBuilderPostRequestConfiguration : RequestConfiguration
+ {
+ }
+ }
+}
+#pragma warning restore CS0618
diff --git a/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/IFromFileAndString/IFromFileAndStringRequestBuilder.verified.cs b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/IFromFileAndString/IFromFileAndStringRequestBuilder.verified.cs
new file mode 100644
index 0000000000..6cf1bf4636
--- /dev/null
+++ b/test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_18236050557cb287/Annotations/IFromFileAndString/IFromFileAndStringRequestBuilder.verified.cs
@@ -0,0 +1,90 @@
+//
+#pragma warning disable CS0618
+using Microsoft.Kiota.Abstractions.Extensions;
+using Microsoft.Kiota.Abstractions.Serialization;
+using Microsoft.Kiota.Abstractions;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
+using System;
+namespace Swashbuckle.AspNetCore.IntegrationTests.KiotaTests.Annotations.IFromFileAndString
+{
+ ///
+ /// Builds and executes requests for operations under \annotations\IFromFileAndString
+ ///
+ [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
+ public partial class IFromFileAndStringRequestBuilder : BaseRequestBuilder
+ {
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// Path parameters for the request
+ /// The request adapter to use to execute the requests.
+ public IFromFileAndStringRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/annotations/IFromFileAndString", pathParameters)
+ {
+ }
+ ///
+ /// Instantiates a new and sets the default values.
+ ///
+ /// The raw URL to use for the request builder.
+ /// The request adapter to use to execute the requests.
+ public IFromFileAndStringRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/annotations/IFromFileAndString", rawUrl)
+ {
+ }
+ /// A
+ /// The request body
+ /// Cancellation token to use when cancelling requests
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public async Task PostAsync(MultipartBody body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#nullable restore
+#else
+ public async Task PostAsync(MultipartBody body, Action> requestConfiguration = default, CancellationToken cancellationToken = default)
+ {
+#endif
+ if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
+ var requestInfo = ToPostRequestInformation(body, requestConfiguration);
+ return await RequestAdapter.SendPrimitiveAsync(requestInfo, default, cancellationToken).ConfigureAwait(false);
+ }
+ /// A
+ /// The request body
+ /// Configuration for the request such as headers, query parameters, and middleware options.
+#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
+#nullable enable
+ public RequestInformation ToPostRequestInformation(MultipartBody body, Action>? requestConfiguration = default)
+ {
+#nullable restore
+#else
+ public RequestInformation ToPostRequestInformation(MultipartBody body, Action> requestConfiguration = default)
+ {
+#endif
+ if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body));
+ var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters);
+ requestInfo.Configure(requestConfiguration);
+ requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9");
+ requestInfo.SetContentFromParsable(RequestAdapter, "multipart/form-data", body);
+ return requestInfo;
+ }
+ ///