From 2f3d02e3b0aaf49659f196fccbb4ed547f1d045b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 17 Nov 2025 13:11:57 +0000 Subject: [PATCH 1/7] Initial plan From 26bdc8836d8f9b6ccb15b4a872679ba1adea29cd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 17 Nov 2025 13:23:08 +0000 Subject: [PATCH 2/7] Upgrade CLI tool and workflows to .NET 10 Co-authored-by: christianhelle <710400+christianhelle@users.noreply.github.com> --- .github/workflows/production-tests.yml | 3 +++ .github/workflows/regression-tests.yml | 3 +++ .github/workflows/release.yml | 2 +- .github/workflows/smoke-tests.yml | 1 + .github/workflows/unit-tests.yml | 5 +++-- .github/workflows/vscode.yml | 2 +- README.md | 2 +- docs/CLI.md | 2 +- .../ApiClientCodeGen.CLI.Tests.csproj | 2 +- src/CLI/ApiClientCodeGen.CLI/ApiClientCodeGen.CLI.csproj | 2 +- .../ApiClientCodeGen.Core.IntegrationTests.csproj | 2 +- .../ApiClientCodeGen.Core.Tests.csproj | 2 +- src/global.json | 4 ++-- 13 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/production-tests.yml b/.github/workflows/production-tests.yml index e167fdee32..c1dfd5fc8a 100644 --- a/.github/workflows/production-tests.yml +++ b/.github/workflows/production-tests.yml @@ -57,6 +57,7 @@ jobs: 7.0.x 8.0.x 9.0.x + 10.0.x - name: Install rapicgen run: dotnet tool install --global rapicgen @@ -395,6 +396,7 @@ jobs: 7.0.x 8.0.x 9.0.x + 10.0.x - name: Install rapicgen run: dotnet tool install --global rapicgen @@ -448,6 +450,7 @@ jobs: 7.0.x 8.0.x 9.0.x + 10.0.x - name: Install rapicgen run: dotnet tool install --global rapicgen diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index 57ca7e69ed..60dfb2dadb 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -58,6 +58,7 @@ jobs: 7.0.x 8.0.x 9.0.x + 10.0.x - name: Prepare Swagger Petstore OpenAPI Spec run: cp ./OpenAPI/${{ matrix.version }}/Swagger.${{ matrix.format }} ./OpenApi.${{ matrix.format }} @@ -393,6 +394,7 @@ jobs: 7.0.x 8.0.x 9.0.x + 10.0.x - name: Prepare Swagger Petstore OpenAPI Spec run: cp ./OpenAPI/${{ matrix.version }}/Swagger.${{ matrix.format }} ./OpenApi.${{ matrix.format }} @@ -443,6 +445,7 @@ jobs: 7.0.x 8.0.x 9.0.x + 10.0.x - name: Prepare Swagger Petstore OpenAPI Spec run: cp ./OpenAPI/${{ matrix.version }}/Swagger.${{ matrix.format }} ./OpenApi.${{ matrix.format }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb36c4906b..9058ba1eed 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -106,7 +106,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v5 with: - dotnet-version: '6.0.x' + dotnet-version: '10.0.x' - name: Setup Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 61c946cd5a..60ac57de6e 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -58,6 +58,7 @@ jobs: 7.0.x 8.0.x 9.0.x + 10.0.x - name: Prepare Swagger Petstore OpenAPI Spec run: cp ./OpenAPI/${{ matrix.version }}/Swagger.${{ matrix.format }} ./OpenApi.${{ matrix.format }} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index c358cd2de3..35fd31f528 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -48,16 +48,17 @@ jobs: 6.0.x 7.0.x 8.0.x + 10.0.x - name: Build with dotnet run: dotnet build Rapicgen.sln working-directory: src - name: Core test project - run: dotnet test src/Core/ApiClientCodeGen.Core.Tests\ApiClientCodeGen.Core.Tests.csproj -f net8.0 + run: dotnet test src/Core/ApiClientCodeGen.Core.Tests\ApiClientCodeGen.Core.Tests.csproj -f net10.0 - name: Core Integration Test project - run: dotnet test src/Core/ApiClientCodeGen.Core.IntegrationTests\ApiClientCodeGen.Core.IntegrationTests.csproj -f net8.0 + run: dotnet test src/Core/ApiClientCodeGen.Core.IntegrationTests\ApiClientCodeGen.Core.IntegrationTests.csproj -f net10.0 vsix: diff --git a/.github/workflows/vscode.yml b/.github/workflows/vscode.yml index 2669627698..4cf08acaf2 100644 --- a/.github/workflows/vscode.yml +++ b/.github/workflows/vscode.yml @@ -28,7 +28,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v5 with: - dotnet-version: '6.0.x' + dotnet-version: '10.0.x' - name: Setup Node.js uses: actions/setup-node@v6 diff --git a/README.md b/README.md index 1e74117b86..ee7090333b 100644 --- a/README.md +++ b/README.md @@ -331,7 +331,7 @@ All custom tools mentioned above are also implemented in a cross platform comman ### Requirements -- .NET 6.0 runtime +- .NET 10.0 runtime - Java Runtime Environment - NPM diff --git a/docs/CLI.md b/docs/CLI.md index e9706be0f0..b7766b00b9 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -4,7 +4,7 @@ All custom tools mentioned above are also implemented in a cross platform comman ## Requirements -- .NET 6.0 runtime +- .NET 10.0 runtime - Java Runtime Environment - NPM diff --git a/src/CLI/ApiClientCodeGen.CLI.Tests/ApiClientCodeGen.CLI.Tests.csproj b/src/CLI/ApiClientCodeGen.CLI.Tests/ApiClientCodeGen.CLI.Tests.csproj index 656f7714bd..2bbf6d9e70 100644 --- a/src/CLI/ApiClientCodeGen.CLI.Tests/ApiClientCodeGen.CLI.Tests.csproj +++ b/src/CLI/ApiClientCodeGen.CLI.Tests/ApiClientCodeGen.CLI.Tests.csproj @@ -1,7 +1,7 @@ - net8.0 + net10.0 Rapicgen.CLI.Tests false diff --git a/src/CLI/ApiClientCodeGen.CLI/ApiClientCodeGen.CLI.csproj b/src/CLI/ApiClientCodeGen.CLI/ApiClientCodeGen.CLI.csproj index 04c0321c11..b340482ecc 100644 --- a/src/CLI/ApiClientCodeGen.CLI/ApiClientCodeGen.CLI.csproj +++ b/src/CLI/ApiClientCodeGen.CLI/ApiClientCodeGen.CLI.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 false Christian Resma Helle REST API Client Code Generator CLI Tool diff --git a/src/Core/ApiClientCodeGen.Core.IntegrationTests/ApiClientCodeGen.Core.IntegrationTests.csproj b/src/Core/ApiClientCodeGen.Core.IntegrationTests/ApiClientCodeGen.Core.IntegrationTests.csproj index bfd611414c..788a264347 100644 --- a/src/Core/ApiClientCodeGen.Core.IntegrationTests/ApiClientCodeGen.Core.IntegrationTests.csproj +++ b/src/Core/ApiClientCodeGen.Core.IntegrationTests/ApiClientCodeGen.Core.IntegrationTests.csproj @@ -1,7 +1,7 @@ - net8.0 + net10.0 false latest diff --git a/src/Core/ApiClientCodeGen.Core.Tests/ApiClientCodeGen.Core.Tests.csproj b/src/Core/ApiClientCodeGen.Core.Tests/ApiClientCodeGen.Core.Tests.csproj index 0e536ad591..d8d5e9dd3b 100644 --- a/src/Core/ApiClientCodeGen.Core.Tests/ApiClientCodeGen.Core.Tests.csproj +++ b/src/Core/ApiClientCodeGen.Core.Tests/ApiClientCodeGen.Core.Tests.csproj @@ -6,7 +6,7 @@ latest - net8.0 + net10.0 diff --git a/src/global.json b/src/global.json index 5203be37ed..ecad56bd3a 100644 --- a/src/global.json +++ b/src/global.json @@ -1,7 +1,7 @@ { "sdk": { - "version": "6.0.428", - "rollForward": "latestMajor", + "version": "10.0.100", + "rollForward": "latestMinor", "allowPrerelease": false } } \ No newline at end of file From 37b0905d8b7a4eebfb5a4a35527b443110c4b9a0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 17 Nov 2025 13:25:03 +0000 Subject: [PATCH 3/7] Complete .NET 10 upgrade - all tests passing Co-authored-by: christianhelle <710400+christianhelle@users.noreply.github.com> --- src/Output.cs | 637 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 637 insertions(+) create mode 100644 src/Output.cs diff --git a/src/Output.cs b/src/Output.cs new file mode 100644 index 0000000000..d88561682b --- /dev/null +++ b/src/Output.cs @@ -0,0 +1,637 @@ + +using Refit; +using System.Collections.Generic; +using System.Text.Json.Serialization; +using System.Threading.Tasks; + +#nullable enable annotations + +namespace GeneratedCode +{ + /// Swagger Petstore + [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.6.5.0")] + public partial interface ISwaggerPetstore + { + /// Add a new pet to the store + /// Pet object that needs to be added to the store + /// A that completes when the request is finished. + /// + /// Thrown when the request returns a non-success status code: + /// + /// + /// Status + /// Description + /// + /// + /// 405 + /// Invalid input + /// + /// + /// + [Post("/pet")] + Task AddPet([Body] Pet body); + + /// Update an existing pet + /// Pet object that needs to be added to the store + /// A that completes when the request is finished. + /// + /// Thrown when the request returns a non-success status code: + /// + /// + /// Status + /// Description + /// + /// + /// 400 + /// Invalid ID supplied + /// + /// + /// 404 + /// Pet not found + /// + /// + /// 405 + /// Validation exception + /// + /// + /// + [Put("/pet")] + Task UpdatePet([Body] Pet body); + + /// Finds Pets by status + /// Multiple status values can be provided with comma separated strings + /// Status values that need to be considered for filter + /// successful operation + /// + /// Thrown when the request returns a non-success status code: + /// + /// + /// Status + /// Description + /// + /// + /// 400 + /// Invalid status value + /// + /// + /// + [Get("/pet/findByStatus")] + Task> FindPetsByStatus([Query(CollectionFormat.Multi)] IEnumerable status); + + /// Finds Pets by tags + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + /// Tags to filter by + /// successful operation + /// + /// Thrown when the request returns a non-success status code: + /// + /// + /// Status + /// Description + /// + /// + /// 400 + /// Invalid tag value + /// + /// + /// + [System.Obsolete] + [Get("/pet/findByTags")] + Task> FindPetsByTags([Query(CollectionFormat.Multi)] IEnumerable tags); + + /// Find pet by ID + /// Returns a single pet + /// ID of pet to return + /// successful operation + /// + /// Thrown when the request returns a non-success status code: + /// + /// + /// Status + /// Description + /// + /// + /// 400 + /// Invalid ID supplied + /// + /// + /// 404 + /// Pet not found + /// + /// + /// + [Get("/pet/{petId}")] + Task GetPetById(long petId); + + /// Updates a pet in the store with form data + /// ID of pet that needs to be updated + /// Updated name of the pet + /// Updated status of the pet + /// A that completes when the request is finished. + /// + /// Thrown when the request returns a non-success status code: + /// + /// + /// Status + /// Description + /// + /// + /// 405 + /// Invalid input + /// + /// + /// + [Post("/pet/{petId}")] + Task UpdatePetWithForm(long petId, string name, string status); + + /// Deletes a pet + /// Pet id to delete + /// A that completes when the request is finished. + /// + /// Thrown when the request returns a non-success status code: + /// + /// + /// Status + /// Description + /// + /// + /// 400 + /// Invalid ID supplied + /// + /// + /// 404 + /// Pet not found + /// + /// + /// + [Delete("/pet/{petId}")] + Task DeletePet(long petId, [Header("api_key")] string api_key); + + /// uploads an image + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 200 + /// successful operation + /// + /// + /// + [Multipart] + [Post("/pet/{petId}/uploadImage")] + Task UploadFile(long petId, string additionalMetadata, StreamPart file); + + /// Returns pet inventories by status + /// Returns a map of status codes to quantities + /// successful operation + /// Thrown when the request returns a non-success status code. + [Get("/store/inventory")] + Task> GetInventory(); + + /// Place an order for a pet + /// order placed for purchasing the pet + /// successful operation + /// + /// Thrown when the request returns a non-success status code: + /// + /// + /// Status + /// Description + /// + /// + /// 400 + /// Invalid Order + /// + /// + /// + [Post("/store/order")] + Task PlaceOrder([Body] Order body); + + /// Find purchase order by ID + /// For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions + /// ID of pet that needs to be fetched + /// successful operation + /// + /// Thrown when the request returns a non-success status code: + /// + /// + /// Status + /// Description + /// + /// + /// 400 + /// Invalid ID supplied + /// + /// + /// 404 + /// Order not found + /// + /// + /// + [Get("/store/order/{orderId}")] + Task GetOrderById(long orderId); + + /// Delete purchase order by ID + /// For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors + /// ID of the order that needs to be deleted + /// A that completes when the request is finished. + /// + /// Thrown when the request returns a non-success status code: + /// + /// + /// Status + /// Description + /// + /// + /// 400 + /// Invalid ID supplied + /// + /// + /// 404 + /// Order not found + /// + /// + /// + [Delete("/store/order/{orderId}")] + Task DeleteOrder(long orderId); + + /// Create user + /// This can only be done by the logged in user. + /// Created user object + /// A that completes when the request is finished. + /// Thrown when the request returns a non-success status code. + [Post("/user")] + Task CreateUser([Body] User body); + + /// Creates list of users with given input array + /// List of user object + /// A that completes when the request is finished. + /// Thrown when the request returns a non-success status code. + [Post("/user/createWithArray")] + Task CreateUsersWithArrayInput([Body] IEnumerable body); + + /// Creates list of users with given input array + /// List of user object + /// A that completes when the request is finished. + /// Thrown when the request returns a non-success status code. + [Post("/user/createWithList")] + Task CreateUsersWithListInput([Body] IEnumerable body); + + /// Logs user into the system + /// The user name for login + /// The password for login in clear text + /// successful operation + /// + /// Thrown when the request returns a non-success status code: + /// + /// + /// Status + /// Description + /// + /// + /// 400 + /// Invalid username/password supplied + /// + /// + /// + [Get("/user/login")] + Task LoginUser([Query] string username, [Query] string password); + + /// Logs out current logged in user session + /// A that completes when the request is finished. + /// Thrown when the request returns a non-success status code. + [Get("/user/logout")] + Task LogoutUser(); + + /// Get user by user name + /// The name that needs to be fetched. Use user1 for testing. + /// successful operation + /// + /// Thrown when the request returns a non-success status code: + /// + /// + /// Status + /// Description + /// + /// + /// 400 + /// Invalid username supplied + /// + /// + /// 404 + /// User not found + /// + /// + /// + [Get("/user/{username}")] + Task GetUserByName(string username); + + /// Updated user + /// This can only be done by the logged in user. + /// name that need to be updated + /// Updated user object + /// A that completes when the request is finished. + /// + /// Thrown when the request returns a non-success status code: + /// + /// + /// Status + /// Description + /// + /// + /// 400 + /// Invalid user supplied + /// + /// + /// 404 + /// User not found + /// + /// + /// + [Put("/user/{username}")] + Task UpdateUser(string username, [Body] User body); + + /// Delete user + /// This can only be done by the logged in user. + /// The name that needs to be deleted + /// A that completes when the request is finished. + /// + /// Thrown when the request returns a non-success status code: + /// + /// + /// Status + /// Description + /// + /// + /// 400 + /// Invalid username supplied + /// + /// + /// 404 + /// User not found + /// + /// + /// + [Delete("/user/{username}")] + Task DeleteUser(string username); + + + } + +} + +//---------------------- +// +// Generated using the NSwag toolchain v14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) +// +//---------------------- + +#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." +#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." +#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' +#pragma warning disable 612 // Disable "CS0612 '...' is obsolete" +#pragma warning disable 649 // Disable "CS0649 Field is never assigned to, and will always have its default value null" +#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... +#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." +#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" +#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" +#pragma warning disable 8600 // Disable "CS8600 Converting null literal or possible null value to non-nullable type" +#pragma warning disable 8602 // Disable "CS8602 Dereference of a possibly null reference" +#pragma warning disable 8603 // Disable "CS8603 Possible null reference return" +#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter" +#pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type" +#pragma warning disable 8765 // Disable "CS8765 Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes)." + +namespace GeneratedCode +{ + using System = global::System; + + + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class Order + { + + [JsonPropertyName("id")] + public long? Id { get; set; } + + [JsonPropertyName("petId")] + public long? PetId { get; set; } + + [JsonPropertyName("quantity")] + public int? Quantity { get; set; } + + [JsonPropertyName("shipDate")] + public System.DateTimeOffset? ShipDate { get; set; } + + /// + /// Order Status + /// + [JsonPropertyName("status")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public OrderStatus? Status { get; set; } + + [JsonPropertyName("complete")] + public bool? Complete { get; set; } = false; + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class User + { + + [JsonPropertyName("id")] + public long? Id { get; set; } + + [JsonPropertyName("username")] + public string Username { get; set; } + + [JsonPropertyName("firstName")] + public string FirstName { get; set; } + + [JsonPropertyName("lastName")] + public string LastName { get; set; } + + [JsonPropertyName("email")] + public string Email { get; set; } + + [JsonPropertyName("password")] + public string Password { get; set; } + + [JsonPropertyName("phone")] + public string Phone { get; set; } + + /// + /// User Status + /// + [JsonPropertyName("userStatus")] + public int? UserStatus { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class Category + { + + [JsonPropertyName("id")] + public long? Id { get; set; } + + [JsonPropertyName("name")] + public string Name { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class Tag + { + + [JsonPropertyName("id")] + public long? Id { get; set; } + + [JsonPropertyName("name")] + public string Name { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class Pet + { + + [JsonPropertyName("id")] + public long? Id { get; set; } + + [JsonPropertyName("category")] + public Category Category { get; set; } + + [JsonPropertyName("name")] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + public string Name { get; set; } + + [JsonPropertyName("photoUrls")] + [System.ComponentModel.DataAnnotations.Required] + public ICollection PhotoUrls { get; set; } = new System.Collections.ObjectModel.Collection(); + + [JsonPropertyName("tags")] + public ICollection Tags { get; set; } + + /// + /// pet status in the store + /// + [JsonPropertyName("status")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public PetStatus? Status { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class ApiResponse + { + + [JsonPropertyName("code")] + public int? Code { get; set; } + + [JsonPropertyName("type")] + public string Type { get; set; } + + [JsonPropertyName("message")] + public string Message { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum Anonymous + { + + [System.Runtime.Serialization.EnumMember(Value = @"available")] + Available = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"pending")] + Pending = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"sold")] + Sold = 2, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum OrderStatus + { + + [System.Runtime.Serialization.EnumMember(Value = @"placed")] + Placed = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"approved")] + Approved = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"delivered")] + Delivered = 2, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum PetStatus + { + + [System.Runtime.Serialization.EnumMember(Value = @"available")] + Available = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"pending")] + Pending = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"sold")] + Sold = 2, + + } + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class FileParameter + { + public FileParameter(System.IO.Stream data) + : this (data, null, null) + { + } + + public FileParameter(System.IO.Stream data, string fileName) + : this (data, fileName, null) + { + } + + public FileParameter(System.IO.Stream data, string fileName, string contentType) + { + Data = data; + FileName = fileName; + ContentType = contentType; + } + + public System.IO.Stream Data { get; private set; } + + public string FileName { get; private set; } + + public string ContentType { get; private set; } + } + + +} + +#pragma warning restore 108 +#pragma warning restore 114 +#pragma warning restore 472 +#pragma warning restore 612 +#pragma warning restore 649 +#pragma warning restore 1573 +#pragma warning restore 1591 +#pragma warning restore 8073 +#pragma warning restore 3016 +#pragma warning restore 8600 +#pragma warning restore 8602 +#pragma warning restore 8603 +#pragma warning restore 8604 +#pragma warning restore 8625 +#pragma warning restore 8765 \ No newline at end of file From b29d525ccfc07982156cb6e8eac3106ccbf2486b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 17 Nov 2025 13:25:29 +0000 Subject: [PATCH 4/7] Remove accidentally committed generated file Co-authored-by: christianhelle <710400+christianhelle@users.noreply.github.com> --- src/Output.cs | 637 -------------------------------------------------- 1 file changed, 637 deletions(-) delete mode 100644 src/Output.cs diff --git a/src/Output.cs b/src/Output.cs deleted file mode 100644 index d88561682b..0000000000 --- a/src/Output.cs +++ /dev/null @@ -1,637 +0,0 @@ - -using Refit; -using System.Collections.Generic; -using System.Text.Json.Serialization; -using System.Threading.Tasks; - -#nullable enable annotations - -namespace GeneratedCode -{ - /// Swagger Petstore - [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.6.5.0")] - public partial interface ISwaggerPetstore - { - /// Add a new pet to the store - /// Pet object that needs to be added to the store - /// A that completes when the request is finished. - /// - /// Thrown when the request returns a non-success status code: - /// - /// - /// Status - /// Description - /// - /// - /// 405 - /// Invalid input - /// - /// - /// - [Post("/pet")] - Task AddPet([Body] Pet body); - - /// Update an existing pet - /// Pet object that needs to be added to the store - /// A that completes when the request is finished. - /// - /// Thrown when the request returns a non-success status code: - /// - /// - /// Status - /// Description - /// - /// - /// 400 - /// Invalid ID supplied - /// - /// - /// 404 - /// Pet not found - /// - /// - /// 405 - /// Validation exception - /// - /// - /// - [Put("/pet")] - Task UpdatePet([Body] Pet body); - - /// Finds Pets by status - /// Multiple status values can be provided with comma separated strings - /// Status values that need to be considered for filter - /// successful operation - /// - /// Thrown when the request returns a non-success status code: - /// - /// - /// Status - /// Description - /// - /// - /// 400 - /// Invalid status value - /// - /// - /// - [Get("/pet/findByStatus")] - Task> FindPetsByStatus([Query(CollectionFormat.Multi)] IEnumerable status); - - /// Finds Pets by tags - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// Tags to filter by - /// successful operation - /// - /// Thrown when the request returns a non-success status code: - /// - /// - /// Status - /// Description - /// - /// - /// 400 - /// Invalid tag value - /// - /// - /// - [System.Obsolete] - [Get("/pet/findByTags")] - Task> FindPetsByTags([Query(CollectionFormat.Multi)] IEnumerable tags); - - /// Find pet by ID - /// Returns a single pet - /// ID of pet to return - /// successful operation - /// - /// Thrown when the request returns a non-success status code: - /// - /// - /// Status - /// Description - /// - /// - /// 400 - /// Invalid ID supplied - /// - /// - /// 404 - /// Pet not found - /// - /// - /// - [Get("/pet/{petId}")] - Task GetPetById(long petId); - - /// Updates a pet in the store with form data - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// A that completes when the request is finished. - /// - /// Thrown when the request returns a non-success status code: - /// - /// - /// Status - /// Description - /// - /// - /// 405 - /// Invalid input - /// - /// - /// - [Post("/pet/{petId}")] - Task UpdatePetWithForm(long petId, string name, string status); - - /// Deletes a pet - /// Pet id to delete - /// A that completes when the request is finished. - /// - /// Thrown when the request returns a non-success status code: - /// - /// - /// Status - /// Description - /// - /// - /// 400 - /// Invalid ID supplied - /// - /// - /// 404 - /// Pet not found - /// - /// - /// - [Delete("/pet/{petId}")] - Task DeletePet(long petId, [Header("api_key")] string api_key); - - /// uploads an image - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// - /// A representing the instance containing the result: - /// - /// - /// Status - /// Description - /// - /// - /// 200 - /// successful operation - /// - /// - /// - [Multipart] - [Post("/pet/{petId}/uploadImage")] - Task UploadFile(long petId, string additionalMetadata, StreamPart file); - - /// Returns pet inventories by status - /// Returns a map of status codes to quantities - /// successful operation - /// Thrown when the request returns a non-success status code. - [Get("/store/inventory")] - Task> GetInventory(); - - /// Place an order for a pet - /// order placed for purchasing the pet - /// successful operation - /// - /// Thrown when the request returns a non-success status code: - /// - /// - /// Status - /// Description - /// - /// - /// 400 - /// Invalid Order - /// - /// - /// - [Post("/store/order")] - Task PlaceOrder([Body] Order body); - - /// Find purchase order by ID - /// For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions - /// ID of pet that needs to be fetched - /// successful operation - /// - /// Thrown when the request returns a non-success status code: - /// - /// - /// Status - /// Description - /// - /// - /// 400 - /// Invalid ID supplied - /// - /// - /// 404 - /// Order not found - /// - /// - /// - [Get("/store/order/{orderId}")] - Task GetOrderById(long orderId); - - /// Delete purchase order by ID - /// For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors - /// ID of the order that needs to be deleted - /// A that completes when the request is finished. - /// - /// Thrown when the request returns a non-success status code: - /// - /// - /// Status - /// Description - /// - /// - /// 400 - /// Invalid ID supplied - /// - /// - /// 404 - /// Order not found - /// - /// - /// - [Delete("/store/order/{orderId}")] - Task DeleteOrder(long orderId); - - /// Create user - /// This can only be done by the logged in user. - /// Created user object - /// A that completes when the request is finished. - /// Thrown when the request returns a non-success status code. - [Post("/user")] - Task CreateUser([Body] User body); - - /// Creates list of users with given input array - /// List of user object - /// A that completes when the request is finished. - /// Thrown when the request returns a non-success status code. - [Post("/user/createWithArray")] - Task CreateUsersWithArrayInput([Body] IEnumerable body); - - /// Creates list of users with given input array - /// List of user object - /// A that completes when the request is finished. - /// Thrown when the request returns a non-success status code. - [Post("/user/createWithList")] - Task CreateUsersWithListInput([Body] IEnumerable body); - - /// Logs user into the system - /// The user name for login - /// The password for login in clear text - /// successful operation - /// - /// Thrown when the request returns a non-success status code: - /// - /// - /// Status - /// Description - /// - /// - /// 400 - /// Invalid username/password supplied - /// - /// - /// - [Get("/user/login")] - Task LoginUser([Query] string username, [Query] string password); - - /// Logs out current logged in user session - /// A that completes when the request is finished. - /// Thrown when the request returns a non-success status code. - [Get("/user/logout")] - Task LogoutUser(); - - /// Get user by user name - /// The name that needs to be fetched. Use user1 for testing. - /// successful operation - /// - /// Thrown when the request returns a non-success status code: - /// - /// - /// Status - /// Description - /// - /// - /// 400 - /// Invalid username supplied - /// - /// - /// 404 - /// User not found - /// - /// - /// - [Get("/user/{username}")] - Task GetUserByName(string username); - - /// Updated user - /// This can only be done by the logged in user. - /// name that need to be updated - /// Updated user object - /// A that completes when the request is finished. - /// - /// Thrown when the request returns a non-success status code: - /// - /// - /// Status - /// Description - /// - /// - /// 400 - /// Invalid user supplied - /// - /// - /// 404 - /// User not found - /// - /// - /// - [Put("/user/{username}")] - Task UpdateUser(string username, [Body] User body); - - /// Delete user - /// This can only be done by the logged in user. - /// The name that needs to be deleted - /// A that completes when the request is finished. - /// - /// Thrown when the request returns a non-success status code: - /// - /// - /// Status - /// Description - /// - /// - /// 400 - /// Invalid username supplied - /// - /// - /// 404 - /// User not found - /// - /// - /// - [Delete("/user/{username}")] - Task DeleteUser(string username); - - - } - -} - -//---------------------- -// -// Generated using the NSwag toolchain v14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) -// -//---------------------- - -#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." -#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." -#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' -#pragma warning disable 612 // Disable "CS0612 '...' is obsolete" -#pragma warning disable 649 // Disable "CS0649 Field is never assigned to, and will always have its default value null" -#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... -#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." -#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" -#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" -#pragma warning disable 8600 // Disable "CS8600 Converting null literal or possible null value to non-nullable type" -#pragma warning disable 8602 // Disable "CS8602 Dereference of a possibly null reference" -#pragma warning disable 8603 // Disable "CS8603 Possible null reference return" -#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter" -#pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type" -#pragma warning disable 8765 // Disable "CS8765 Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes)." - -namespace GeneratedCode -{ - using System = global::System; - - - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class Order - { - - [JsonPropertyName("id")] - public long? Id { get; set; } - - [JsonPropertyName("petId")] - public long? PetId { get; set; } - - [JsonPropertyName("quantity")] - public int? Quantity { get; set; } - - [JsonPropertyName("shipDate")] - public System.DateTimeOffset? ShipDate { get; set; } - - /// - /// Order Status - /// - [JsonPropertyName("status")] - [JsonConverter(typeof(JsonStringEnumConverter))] - public OrderStatus? Status { get; set; } - - [JsonPropertyName("complete")] - public bool? Complete { get; set; } = false; - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class User - { - - [JsonPropertyName("id")] - public long? Id { get; set; } - - [JsonPropertyName("username")] - public string Username { get; set; } - - [JsonPropertyName("firstName")] - public string FirstName { get; set; } - - [JsonPropertyName("lastName")] - public string LastName { get; set; } - - [JsonPropertyName("email")] - public string Email { get; set; } - - [JsonPropertyName("password")] - public string Password { get; set; } - - [JsonPropertyName("phone")] - public string Phone { get; set; } - - /// - /// User Status - /// - [JsonPropertyName("userStatus")] - public int? UserStatus { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class Category - { - - [JsonPropertyName("id")] - public long? Id { get; set; } - - [JsonPropertyName("name")] - public string Name { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class Tag - { - - [JsonPropertyName("id")] - public long? Id { get; set; } - - [JsonPropertyName("name")] - public string Name { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class Pet - { - - [JsonPropertyName("id")] - public long? Id { get; set; } - - [JsonPropertyName("category")] - public Category Category { get; set; } - - [JsonPropertyName("name")] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Name { get; set; } - - [JsonPropertyName("photoUrls")] - [System.ComponentModel.DataAnnotations.Required] - public ICollection PhotoUrls { get; set; } = new System.Collections.ObjectModel.Collection(); - - [JsonPropertyName("tags")] - public ICollection Tags { get; set; } - - /// - /// pet status in the store - /// - [JsonPropertyName("status")] - [JsonConverter(typeof(JsonStringEnumConverter))] - public PetStatus? Status { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class ApiResponse - { - - [JsonPropertyName("code")] - public int? Code { get; set; } - - [JsonPropertyName("type")] - public string Type { get; set; } - - [JsonPropertyName("message")] - public string Message { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum Anonymous - { - - [System.Runtime.Serialization.EnumMember(Value = @"available")] - Available = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"pending")] - Pending = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"sold")] - Sold = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum OrderStatus - { - - [System.Runtime.Serialization.EnumMember(Value = @"placed")] - Placed = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"approved")] - Approved = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"delivered")] - Delivered = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] - public enum PetStatus - { - - [System.Runtime.Serialization.EnumMember(Value = @"available")] - Available = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"pending")] - Pending = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"sold")] - Sold = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.6.0.0 (NJsonSchema v11.5.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class FileParameter - { - public FileParameter(System.IO.Stream data) - : this (data, null, null) - { - } - - public FileParameter(System.IO.Stream data, string fileName) - : this (data, fileName, null) - { - } - - public FileParameter(System.IO.Stream data, string fileName, string contentType) - { - Data = data; - FileName = fileName; - ContentType = contentType; - } - - public System.IO.Stream Data { get; private set; } - - public string FileName { get; private set; } - - public string ContentType { get; private set; } - } - - -} - -#pragma warning restore 108 -#pragma warning restore 114 -#pragma warning restore 472 -#pragma warning restore 612 -#pragma warning restore 649 -#pragma warning restore 1573 -#pragma warning restore 1591 -#pragma warning restore 8073 -#pragma warning restore 3016 -#pragma warning restore 8600 -#pragma warning restore 8602 -#pragma warning restore 8603 -#pragma warning restore 8604 -#pragma warning restore 8625 -#pragma warning restore 8765 \ No newline at end of file From ee98aaada1590fd0051c63484539e792db2ef7f5 Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Mon, 17 Nov 2025 15:45:22 +0100 Subject: [PATCH 5/7] Add .NET 10 setup to workflows for CLI tool, release, and SonarCloud --- .github/workflows/cli-tool.yml | 5 +++++ .github/workflows/release.yml | 4 ++++ .github/workflows/sonar-cloud.yml | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/.github/workflows/cli-tool.yml b/.github/workflows/cli-tool.yml index 9d77adba5d..6a50df0553 100644 --- a/.github/workflows/cli-tool.yml +++ b/.github/workflows/cli-tool.yml @@ -39,6 +39,11 @@ jobs: run: ((Get-Content -Path Core/ApiClientCodeGen.Core/ApiClientCodeGen.Core.csproj -Raw) -Replace ">1.0.0<", ">${{ env.VERSION }}<") | Set-Content -Path Core/ApiClientCodeGen.Core/ApiClientCodeGen.Core.csproj working-directory: src + - name: Setup .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: '10.0.x' + - name: Build with dotnet run: dotnet build Rapicgen.sln working-directory: src diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9058ba1eed..8401e9fefd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,6 +29,10 @@ jobs: - name: Update Version run: ((Get-Content -Path Core/ApiClientCodeGen.Core/ApiClientCodeGen.Core.csproj -Raw) -Replace ">1.0.0<", ">${{ env.VERSION }}<") | Set-Content -Path Core/ApiClientCodeGen.Core/ApiClientCodeGen.Core.csproj working-directory: src + - name: Setup .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: '10.0.x' - name: Build run: dotnet build -c Release /p:UseSourceLink=true src/Rapicgen.sln -p:PackageVersion="${{ env.VERSION }}" - name: Package CLI Tool diff --git a/.github/workflows/sonar-cloud.yml b/.github/workflows/sonar-cloud.yml index fee1d448d8..1bc44dee05 100644 --- a/.github/workflows/sonar-cloud.yml +++ b/.github/workflows/sonar-cloud.yml @@ -49,6 +49,11 @@ jobs: key: ${{ runner.os }}-sonar-scanner restore-keys: ${{ runner.os }}-sonar-scanner + - name: Setup .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: '10.0.x' + - name: Install SonarCloud scanner shell: powershell run: dotnet tool update dotnet-sonarscanner --tool-path .\src\.sonar\scanner From 2abca1686edbfc69882191fcfb1f2ece2added25 Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Mon, 17 Nov 2025 15:55:52 +0100 Subject: [PATCH 6/7] Upgrade workflows to support .NET 10 in smoke tests, SonarCloud, and VSIX --- .github/workflows/smoke-tests.yml | 4 ++++ .github/workflows/sonar-cloud.yml | 5 +++++ .github/workflows/vsix.yml | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 60ac57de6e..9f2e5908b7 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -387,6 +387,8 @@ jobs: 6.0.x 7.0.x 8.0.x + 9.0.x + 10.0.x - name: Prepare Swagger Petstore OpenAPI Spec run: cp ./OpenAPI/${{ matrix.version }}/Swagger.${{ matrix.format }} ./OpenApi.${{ matrix.format }} @@ -429,6 +431,8 @@ jobs: 6.0.x 7.0.x 8.0.x + 9.0.x + 10.0.x - name: Prepare Swagger Petstore OpenAPI Spec run: cp ./OpenAPI/${{ matrix.version }}/Swagger.${{ matrix.format }} ./OpenApi.${{ matrix.format }} diff --git a/.github/workflows/sonar-cloud.yml b/.github/workflows/sonar-cloud.yml index 1bc44dee05..2d04e759e2 100644 --- a/.github/workflows/sonar-cloud.yml +++ b/.github/workflows/sonar-cloud.yml @@ -23,6 +23,11 @@ jobs: - uses: actions/checkout@v5 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + + - name: Setup .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: '10.0.x' - name: Set up JDK 17 uses: actions/setup-java@v5 diff --git a/.github/workflows/vsix.yml b/.github/workflows/vsix.yml index e5d55b51b8..90bed2b7de 100644 --- a/.github/workflows/vsix.yml +++ b/.github/workflows/vsix.yml @@ -27,6 +27,11 @@ jobs: steps: - uses: actions/checkout@v5 + + - name: Setup .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: '10.0.x' - name: Update Version run: | From 2a8f5af90ab76d050727705c34a770cfbadc5025 Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Tue, 18 Nov 2025 08:14:59 +0100 Subject: [PATCH 7/7] Setup .NET 10 SDK in unit tests workflow --- .github/workflows/unit-tests.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 35fd31f528..7147016c37 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -48,6 +48,7 @@ jobs: 6.0.x 7.0.x 8.0.x + 9.0.x 10.0.x - name: Build with dotnet @@ -69,6 +70,19 @@ jobs: steps: - uses: actions/checkout@v5 + - name: Setup .NET versions + uses: actions/setup-dotnet@v5 + with: + dotnet-version: | + 2.1.x + 3.1.x + 5.0.x + 6.0.x + 7.0.x + 8.0.x + 9.0.x + 10.0.x + - name: Setup MSBuild.exe uses: microsoft/setup-msbuild@v2