Skip to content

Commit

Permalink
fix: Fixed generator for enum type parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
gunpal5 authored and HavenDV committed Apr 2, 2024
1 parent 753a400 commit 027c24d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/libs/OpenAI.Generators/SourceGenerationHelper.cs
Expand Up @@ -212,6 +212,7 @@ public static (string Name, string Description, global::System.Text.Json.Nodes.J
global::System.Text.Json.JsonSerializer.Deserialize<{extensionsClassName}.{method.Name}Args>(json, new global::System.Text.Json.JsonSerializerOptions
{{
PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
Converters = {{{{ new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) }}}}
}}) ??
throw new global::System.InvalidOperationException(""Could not deserialize JSON."");
}}
Expand Down
2 changes: 1 addition & 1 deletion src/libs/OpenAI/OpenAI.csproj
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net4.6.2;net6.0;net7.0;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Using Include="System.Text.Json" />
</ItemGroup>
Expand Down

0 comments on commit 027c24d

Please sign in to comment.