to

infix fun String.to(value: String)

Add a property using infix to syntax.

Example:

"name" to "John Doe"
"age" to 30
"active" to true

infix fun String.to(value: Number)

Add a number property.


infix fun String.to(value: Boolean)

Add a boolean property.


infix fun String.to(value: JsonElement)

Add a JsonElement property (for nested objects, arrays, etc.).


infix fun String.to(block: SubjectObjectBuilder.() -> Unit)

Add a nested object using 'to' syntax with DSL-style builder.

Example:

"degree" to {
"type" to "BachelorDegree"
"name" to "Bachelor of Science"
}

Inside the block, use "key" to value syntax (DSL-style).


infix fun String.to(value: List<*>)

Add an array of primitives or mixed types.

Example:

"skills" to listOf("Kotlin", "Java", "Python")
"numbers" to listOf(1, 2, 3)

infix fun String.to(blocks: ArrayOfObjects)

Add an array of objects using DSL syntax.

Example:

"grades" to arrayOfObjects(
{ "courseCode" to "CS101"; "grade" to "A" },
{ "courseCode" to "MATH101"; "grade" to "B" }
)