-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Generated schema example
package com.anymindgroup.gcp.aiplatform.v1.schemas
import com.github.plokhotnyuk.jsoniter_scala.core.*
import com.github.plokhotnyuk.jsoniter_scala.macros.*
case class GoogleCloudAiplatformV1FunctionCall(
// Optional
// The name of the function to call
// Matches [FunctionDeclaration.name].
name: Option[String] = None,
// Optional
// The function parameters and values in JSON object format
// See [FunctionDeclaration.parameters] for parameter details.
args: Option[Map[String, Option[String]]] = None
) {
def toJsonString: String = writeToString(this)
}
object GoogleCloudAiplatformV1FunctionCall {
given jsonCodec: JsonValueCodec[GoogleCloudAiplatformV1FunctionCall] =
JsonCodecMaker.make(CodecMakerConfig.withAllowRecursiveTypes(true).withDiscriminatorFieldName(None))
}Fails to deserialize when args contains some JSON object.
Instead of args: Option[Map[String, Option[String]]] it should be like args: Option[Map[String, Json]], but a Json type is not available in jsoniter.
Example workaround of adding AST support: Scala 3 AST
Metadata
Metadata
Assignees
Labels
No labels