Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/A2A/KebabCaseLowerJsonStringEnumConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.ComponentModel;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace A2A;

/// <summary>
/// A JSON string enum converter that converts enum values to kebab-case lower strings.
/// </summary>
/// <typeparam name="TEnum">The type of the enum to convert.</typeparam>
[EditorBrowsable(EditorBrowsableState.Never)]
public sealed class KebabCaseLowerJsonStringEnumConverter<TEnum>() :
JsonStringEnumConverter<TEnum>(JsonNamingPolicy.KebabCaseLower)
where TEnum : struct, Enum;
2 changes: 1 addition & 1 deletion src/A2A/Models/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace A2A;
/// <summary>
/// Message sender's role.
/// </summary>
[JsonConverter(typeof(MessageRoleConverter))]
[JsonConverter(typeof(KebabCaseLowerJsonStringEnumConverter<MessageRole>))]
public enum MessageRole
{
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/A2A/Models/TaskState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace A2A;
/// <summary>
/// Represents the possible states of a Task.
/// </summary>
[JsonConverter(typeof(TaskStateJsonConverter))]
[JsonConverter(typeof(KebabCaseLowerJsonStringEnumConverter<TaskState>))]
public enum TaskState
{
/// <summary>
Expand Down
48 changes: 0 additions & 48 deletions src/A2A/Models/TaskStateJsonConverter.cs

This file was deleted.