From cc66a141a610a9655fac03caac00a9160056d9d0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:36:03 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=90=9D=20Update=20SDK=20-=201=20?= =?UTF-8?q?-=20Generate=201.3.0=20(#65)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.376.0 * Update project file to version 1.3.0 --------- Co-authored-by: speakeasybot Co-authored-by: GitHub Actions --- .speakeasy/gen.lock | 14 +++++------ .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 10 ++++---- NUGET.md | 2 +- README.md | 2 +- RELEASES.md | 12 +++++++++- Styra/Opa/OpenApi/Models/Components/Input.cs | 10 ++++++++ .../OpenApi/Models/Components/Responses.cs | 4 ++++ Styra/Opa/OpenApi/Models/Components/Result.cs | 10 ++++++++ Styra/Opa/OpenApi/OpaApiClient.cs | 6 ++--- Styra/Opa/OpenApi/Utils/EnumConverter.cs | 3 ++- .../OpenApi/Utils/RequestBodySerializer.cs | 24 +++++++++++++++++-- Styra/Opa/OpenApi/Utils/Utilities.cs | 4 ++++ Styra/Opa/Styra.Opa.csproj | 2 +- 14 files changed, 82 insertions(+), 23 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 87ab02d..439a3e5 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -3,10 +3,10 @@ id: f1a8c321-72a7-41c5-8f5e-3d925aeafa1a management: docChecksum: 553ed43ff98c81b3e770c34850f0b5f5 docVersion: 0.2.0 - speakeasyVersion: 1.352.2 - generationVersion: 2.385.2 - releaseVersion: 1.2.0 - configChecksum: 659ee3d7309818ed01bc14bb1b03e0c3 + speakeasyVersion: 1.376.0 + generationVersion: 2.402.5 + releaseVersion: 1.3.0 + configChecksum: 8bf5fcab319b53e5be5a8ead50747add repoURL: https://github.com/StyraInc/opa-csharp.git repoSubDirectory: Styra/Opa/OpenApi/ published: true @@ -14,17 +14,17 @@ features: csharp: additionalDependencies: 0.1.0 constsAndDefaults: 0.0.1 - core: 3.9.13 + core: 3.9.14 examples: 2.81.3 flattening: 2.81.2 - globalSecurity: 2.83.5 + globalSecurity: 2.83.6 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 globalServerURLs: 2.82.3 intellisenseMarkdownSupport: 0.1.0 responseFormat: 0.0.4 sdkHooks: 0.1.0 - unions: 0.1.3 + unions: 0.2.1 generatedFiles: - Styra/Opa/OpenApi/OpaApiClient.cs - global.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 63bc807..eafca4d 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: false csharp: - version: 1.2.0 + version: 1.3.0 additionalDependencies: [] author: Styra clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 046dc66..961bd9b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.352.2 +speakeasyVersion: 1.376.0 sources: openapi: sourceNamespace: openapi - sourceRevisionDigest: sha256:1ea271533d89cb4fb0eb21aebd9f29faf57ceb1e10c0dc409e24b0e388f0f55e - sourceBlobDigest: sha256:98a8568956da7c8d356c615d9fb29a0977a42a0240bac354ba65f5282005b5d6 + sourceRevisionDigest: sha256:76713cfaf47149b60b8bc5b10e999975d990f679fdb446fc0a6ee6835fa9c1e0 + sourceBlobDigest: sha256:1d6f0889215e37eb283c5904aec019dae6cb01c589ba6afdc0d51d95d6539ec7 tags: - latest - main @@ -11,8 +11,8 @@ targets: first-target: source: openapi sourceNamespace: openapi - sourceRevisionDigest: sha256:1ea271533d89cb4fb0eb21aebd9f29faf57ceb1e10c0dc409e24b0e388f0f55e - sourceBlobDigest: sha256:98a8568956da7c8d356c615d9fb29a0977a42a0240bac354ba65f5282005b5d6 + sourceRevisionDigest: sha256:76713cfaf47149b60b8bc5b10e999975d990f679fdb446fc0a6ee6835fa9c1e0 + sourceBlobDigest: sha256:1d6f0889215e37eb283c5904aec019dae6cb01c589ba6afdc0d51d95d6539ec7 outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/NUGET.md b/NUGET.md index f058766..a820a0a 100644 --- a/NUGET.md +++ b/NUGET.md @@ -157,7 +157,7 @@ This SDK supports the following security scheme globally: | ------------ | ------------ | ------------ | | `BearerAuth` | http | HTTP Bearer | -To authenticate with the API the `Null` parameter must be set when initializing the SDK client instance. For example: +To authenticate with the API the `BearerAuth` parameter must be set when initializing the SDK client instance. For example: ```csharp using Styra.Opa.OpenApi; using Styra.Opa.OpenApi.Models.Requests; diff --git a/README.md b/README.md index 83e5ab8..0bf9ff7 100644 --- a/README.md +++ b/README.md @@ -294,7 +294,7 @@ This SDK supports the following security scheme globally: | ------------ | ------------ | ------------ | | `BearerAuth` | http | HTTP Bearer | -To authenticate with the API the `Null` parameter must be set when initializing the SDK client instance. For example: +To authenticate with the API the `BearerAuth` parameter must be set when initializing the SDK client instance. For example: ```csharp using Styra.Opa.OpenApi; using Styra.Opa.OpenApi.Models.Requests; diff --git a/RELEASES.md b/RELEASES.md index eab2908..1afcb09 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -245,4 +245,14 @@ Based on: ### Generated - [csharp v1.2.0] . ### Releases -- [NuGet v1.2.0] https://www.nuget.org/packages/Styra.Opa.OpenApi/1.2.0 - . \ No newline at end of file +- [NuGet v1.2.0] https://www.nuget.org/packages/Styra.Opa.OpenApi/1.2.0 - . + +## 2024-08-19 16:29:28 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.376.0 (2.402.5) https://github.com/speakeasy-api/speakeasy +### Generated +- [csharp v1.3.0] . +### Releases +- [NuGet v1.3.0] https://www.nuget.org/packages/Styra.Opa.OpenApi/1.3.0 - . \ No newline at end of file diff --git a/Styra/Opa/OpenApi/Models/Components/Input.cs b/Styra/Opa/OpenApi/Models/Components/Input.cs index 408d0d5..e9a5e7b 100644 --- a/Styra/Opa/OpenApi/Models/Components/Input.cs +++ b/Styra/Opa/OpenApi/Models/Components/Input.cs @@ -72,10 +72,20 @@ public class Input { public Input(InputType type) { Type = type; } + + [SpeakeasyMetadata("form:explode=true")] public bool? Boolean { get; set; } + + [SpeakeasyMetadata("form:explode=true")] public string? Str { get; set; } + + [SpeakeasyMetadata("form:explode=true")] public double? Number { get; set; } + + [SpeakeasyMetadata("form:explode=true")] public List? ArrayOfAny { get; set; } + + [SpeakeasyMetadata("form:explode=true")] public Dictionary? MapOfAny { get; set; } public InputType Type { get; set; } diff --git a/Styra/Opa/OpenApi/Models/Components/Responses.cs b/Styra/Opa/OpenApi/Models/Components/Responses.cs index aea9b4b..77b9678 100644 --- a/Styra/Opa/OpenApi/Models/Components/Responses.cs +++ b/Styra/Opa/OpenApi/Models/Components/Responses.cs @@ -60,7 +60,11 @@ public class Responses { public Responses(ResponsesType type) { Type = type; } + + [SpeakeasyMetadata("form:explode=true")] public ResponsesSuccessfulPolicyResponse? ResponsesSuccessfulPolicyResponse { get; set; } + + [SpeakeasyMetadata("form:explode=true")] public Models.Components.ServerError? ServerError { get; set; } public ResponsesType Type { get; set; } diff --git a/Styra/Opa/OpenApi/Models/Components/Result.cs b/Styra/Opa/OpenApi/Models/Components/Result.cs index 6af77f4..d49d6e1 100644 --- a/Styra/Opa/OpenApi/Models/Components/Result.cs +++ b/Styra/Opa/OpenApi/Models/Components/Result.cs @@ -72,10 +72,20 @@ public class Result { public Result(ResultType type) { Type = type; } + + [SpeakeasyMetadata("form:explode=true")] public bool? Boolean { get; set; } + + [SpeakeasyMetadata("form:explode=true")] public string? Str { get; set; } + + [SpeakeasyMetadata("form:explode=true")] public double? Number { get; set; } + + [SpeakeasyMetadata("form:explode=true")] public List? ArrayOfAny { get; set; } + + [SpeakeasyMetadata("form:explode=true")] public Dictionary? MapOfAny { get; set; } public ResultType Type { get; set; } diff --git a/Styra/Opa/OpenApi/OpaApiClient.cs b/Styra/Opa/OpenApi/OpaApiClient.cs index d14bc6a..603c8ba 100644 --- a/Styra/Opa/OpenApi/OpaApiClient.cs +++ b/Styra/Opa/OpenApi/OpaApiClient.cs @@ -103,10 +103,10 @@ public class OpaApiClient: IOpaApiClient public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "1.2.0"; - private const string _sdkGenVersion = "2.385.2"; + private const string _sdkVersion = "1.3.0"; + private const string _sdkGenVersion = "2.402.5"; private const string _openapiDocVersion = "0.2.0"; - private const string _userAgent = "speakeasy-sdk/csharp 1.2.0 2.385.2 0.2.0 Styra.Opa.OpenApi"; + private const string _userAgent = "speakeasy-sdk/csharp 1.3.0 2.402.5 0.2.0 Styra.Opa.OpenApi"; private string _serverUrl = ""; private int _serverIndex = 0; private ISpeakeasyHttpClient _client; diff --git a/Styra/Opa/OpenApi/Utils/EnumConverter.cs b/Styra/Opa/OpenApi/Utils/EnumConverter.cs index 6ff23f5..f5c1aec 100644 --- a/Styra/Opa/OpenApi/Utils/EnumConverter.cs +++ b/Styra/Opa/OpenApi/Utils/EnumConverter.cs @@ -40,7 +40,8 @@ JsonSerializer serializer var extensionType = System.Type.GetType(objectType.FullName + "Extension"); if (Nullable.GetUnderlyingType(objectType) != null) { - extensionType = System.Type.GetType(Nullable.GetUnderlyingType(objectType)!.FullName + "Extension"); + objectType = Nullable.GetUnderlyingType(objectType)!; + extensionType = System.Type.GetType(objectType!.FullName + "Extension"); } if (extensionType == null) diff --git a/Styra/Opa/OpenApi/Utils/RequestBodySerializer.cs b/Styra/Opa/OpenApi/Utils/RequestBodySerializer.cs index c196e0b..c0e06ed 100644 --- a/Styra/Opa/OpenApi/Utils/RequestBodySerializer.cs +++ b/Styra/Opa/OpenApi/Utils/RequestBodySerializer.cs @@ -399,11 +399,31 @@ ref Dictionary> form form[metadata.Name] = new List(); } - form[metadata.Name].Add(Utilities.ValueToString(val)); + if (Utilities.IsList(val)) + { + foreach(var item in (IEnumerable)val) + { + form[metadata.Name].Add(Utilities.ValueToString(item)); + } + } + else + { + form[metadata.Name].Add(Utilities.ValueToString(val)); + } } else { - items.Add($"{metadata.Name},{Utilities.ValueToString(val)}"); + if (Utilities.IsList(val)) + { + foreach(var item in (IEnumerable)val) + { + items.Add($"{metadata.Name},{Utilities.ValueToString(item)}"); + } + } + else + { + items.Add($"{metadata.Name},{Utilities.ValueToString(val)}"); + } } } diff --git a/Styra/Opa/OpenApi/Utils/Utilities.cs b/Styra/Opa/OpenApi/Utils/Utilities.cs index d8d71da..777b298 100644 --- a/Styra/Opa/OpenApi/Utils/Utilities.cs +++ b/Styra/Opa/OpenApi/Utils/Utilities.cs @@ -208,6 +208,10 @@ public static string ValueToString(object? value) } return (string)(method.Invoke(null, new[] { value }) ?? ""); } + else if (IsDictionary(value)) + { + return JsonConvert.SerializeObject(value, GetDefaultJsonSerializerSettings()); + } return value.ToString() ?? ""; } diff --git a/Styra/Opa/Styra.Opa.csproj b/Styra/Opa/Styra.Opa.csproj index 23ecd26..715ff1b 100644 --- a/Styra/Opa/Styra.Opa.csproj +++ b/Styra/Opa/Styra.Opa.csproj @@ -2,7 +2,7 @@ true Styra.Opa - 1.2.0 + 1.3.0 Styra net6.0 enable