diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index 1067f6b396ce..a682981a22f3 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -142,37 +142,19 @@ jobs: path: modules/openapi-generator-cli/target - name: Delete samples that are entirely generated run: | - rm -rf samples/client/petstore/csharp/generichost/latest/HelloWorld - rm -rf samples/client/petstore/csharp/generichost/latest/Tags - rm -rf samples/client/petstore/csharp/generichost/latest/OneOfList - - rm -rf samples/client/petstore/csharp/generichost/net8/AllOf - rm -rf samples/client/petstore/csharp/generichost/net8/AnyOf - rm -rf samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare - rm -rf samples/client/petstore/csharp/generichost/net8/FormModels - rm -rf samples/client/petstore/csharp/generichost/net8/NullReferenceTypes - rm -rf samples/client/petstore/csharp/generichost/net8/OneOf - rm -rf samples/client/petstore/csharp/generichost/net8/Petstore - rm -rf samples/client/petstore/csharp/generichost/net8/SourceGeneration - rm -rf samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate - - rm -rf samples/client/petstore/csharp/generichost/standard2.0/Petstore - - rm -rf samples/client/petstore/csharp/generichost/net4.8/AllOf - rm -rf samples/client/petstore/csharp/generichost/net4.8/AnyOf - rm -rf samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare - rm -rf samples/client/petstore/csharp/generichost/net4.8/FormModels - rm -rf samples/client/petstore/csharp/generichost/net4.8/OneOf - rm -rf samples/client/petstore/csharp/generichost/net4.8/Petstore - rm -rf samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate - - rm -rf samples/client/petstore/csharp/generichost/net4.7/AllOf - rm -rf samples/client/petstore/csharp/generichost/net4.7/AnyOf - rm -rf samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare - rm -rf samples/client/petstore/csharp/generichost/net4.7/FormModels - rm -rf samples/client/petstore/csharp/generichost/net4.7/OneOf - rm -rf samples/client/petstore/csharp/generichost/net4.7/Petstore - rm -rf samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate + # List all directories in generichost, filter out Manual directories, and remove the rest + cd samples/client/petstore/csharp/generichost + for version_dir in */ ; do + if [ -d "$version_dir" ]; then + cd "$version_dir" + for dir in */ ; do + if [ -d "$dir" ] && [[ ! "$dir" =~ Manual ]]; then + rm -rf "$dir" + fi + done + cd .. + fi + done - name: Generate samples run: | bash bin/generate-samples.sh diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/ConsoleApp1/ConsoleApp1.csproj b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/ConsoleApp1/ConsoleApp1.csproj deleted file mode 100644 index 36fea751ab90..000000000000 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/ConsoleApp1/ConsoleApp1.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - Exe - net9.0 - enable - enable - - - - - - - diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/ConsoleApp1/Program.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/ConsoleApp1/Program.cs deleted file mode 100644 index 82286737b3d0..000000000000 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/ConsoleApp1/Program.cs +++ /dev/null @@ -1,61 +0,0 @@ -//namespace ConsoleApp1 -//{ -// internal class Program -// { -// static void Main(string[] args) -// { -// Console.WriteLine("Hello, World!"); -// } -// } -//} - -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.DependencyInjection; -using Org.OpenAPITools.Api; -using Org.OpenAPITools.Client; -using Org.OpenAPITools.Model; -using Org.OpenAPITools.Extensions; - -namespace YourProject -{ - public class Program - { - public static async Task Main(string[] args) - { - var host = CreateHostBuilder(args).Build(); - var api = host.Services.GetRequiredService(); - ICall123TestSpecialTagsApiResponse apiResponse = await api.Call123TestSpecialTagsAsync("todo"); - ModelClient? model = apiResponse.Ok(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) - .ConfigureApi((context, services, options) => - { - // The type of token here depends on the api security specifications - // Available token types are ApiKeyToken, BasicToken, BearerToken, HttpSigningToken, and OAuthToken. - BearerToken token = new(""); - options.AddTokens(token); - - // optionally choose the method the tokens will be provided with, default is RateLimitProvider - options.UseProvider, BearerToken>(); - - options.ConfigureJsonOptions((jsonOptions) => - { - // your custom converters if any - }); - - options.AddApiHttpClients(client => - { - // client configuration - }, builder => - { - builder - .AddRetryPolicy(2) - .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) - .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)); - // add whatever middleware you prefer - } - ); - }); - } -} \ No newline at end of file