File tree Expand file tree Collapse file tree
commonMain/kotlin/com/agentclientprotocol/model
commonTest/kotlin/com/agentclientprotocol/model Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -522,7 +522,7 @@ public data class ListProvidersRequest(
522522@UnstableApi
523523@Serializable
524524public data class SetProvidersRequest (
525- val id : String ,
525+ @SerialName( " providerId " ) val id : String ,
526526 val apiType : LlmProtocol ,
527527 val baseUrl : String ,
528528 val headers : Map <String , String >? = null ,
@@ -539,7 +539,7 @@ public data class SetProvidersRequest(
539539@UnstableApi
540540@Serializable
541541public data class DisableProvidersRequest (
542- val id : String ,
542+ @SerialName( " providerId " ) val id : String ,
543543 override val _meta : JsonElement ? = null
544544) : AcpRequest
545545
@@ -663,7 +663,7 @@ public data class ProviderCurrentConfig(
663663@UnstableApi
664664@Serializable
665665public data class ProviderInfo (
666- val id : String ,
666+ @SerialName( " providerId " ) val id : String ,
667667 val supported : List <LlmProtocol >,
668668 val required : Boolean ,
669669 val current : ProviderCurrentConfig ? = null ,
Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ class ProvidersSerializationTest {
5757 val encoded = ACPJson .encodeToString(ProviderInfo .serializer(), info)
5858 val decoded = ACPJson .decodeFromString(ProviderInfo .serializer(), encoded)
5959
60+ assertTrue(encoded.contains(" \" providerId\" " ))
61+ assertFalse(encoded.contains(" \" id\" " ))
6062 assertEquals(info, decoded)
6163 }
6264
@@ -80,7 +82,7 @@ class ProvidersSerializationTest {
8082 fun `incoming JSON with current null is accepted and mapped to disabled` () {
8183 val payload = """
8284 {
83- "id ": "main",
85+ "providerId ": "main",
8486 "supported": ["openai"],
8587 "required": false,
8688 "current": null
@@ -105,6 +107,7 @@ class ProvidersSerializationTest {
105107 val withoutHeadersJson = ACPJson .encodeToString(SetProvidersRequest .serializer(), withoutHeaders)
106108 val withoutHeadersDecoded = ACPJson .decodeFromString(SetProvidersRequest .serializer(), withoutHeadersJson)
107109
110+ assertTrue(withoutHeadersJson.contains(" \" providerId\" " ))
108111 assertFalse(withoutHeadersJson.contains(" \" headers\" " ))
109112 assertNull(withoutHeadersDecoded.headers)
110113
You can’t perform that action at this time.
0 commit comments