Invalid names inside serialization
See original GitHub issueHello!
When using “kotlin.js.compiler=ir” breaks the field names. Incorrect field names then do not work in the tabulator
Without kotlin.js.compiler=ir
With kotlin.js.compiler=ir
// model
@Serializable
data class Test(
var id: Int? = null,
var name: String? = null,
var text: String? = null,
)
//service
@KVService
interface IPingService {
suspend fun ping(test: Test): Test
}
// backend
actual class PingService : IPingService {
override suspend fun ping(test: Test): Test {
println(test)
return test
}
}
//frontend
object Model {
private val pingService = PingService()
suspend fun ping(test: Test): Test {
return pingService.ping(test)
}
}
class App : Application() {
override fun start(state: Map<String, Any>) {
val root = root("kvapp") {
}
AppScope.launch {
val pingResult = Model.ping(Test(name= "Hello world from client!"))
console.log("pingResult = ",pingResult)
}
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
XML Serialization of an Object Containing invalid chars
Well, I've gone with this solution. · You're in good shape, unless the invalid characters were actually important. · 1 · 2 ·...
Read more >Enforce valid XML tags in NVP · Issue #168 - GitHub
In some situations it is possible to compile code that will generate XML tags that are invalid. For example: template<class Ar> void serialize( ......
Read more >Object Serialization Enhancements in Previous Releases
Bug fix: Invalid serialPersistentFields field name causes ... Serialization will now throw InvalidClassExceptions in such cases (since it is never necessary ...
Read more >How to write custom converters for JSON serialization - .NET
Json , see How to serialize and deserialize JSON in .NET. ... InvariantCulture); public override void Write( Utf8JsonWriter writer, ...
Read more >Serialize JSON with invalid C# names - Unity Answers
Serialize JSON with invalid C# names. Hi all I have an existing Rest API ... Sadly C# does not support the - as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi. When using IR compiler with Tabulator you can do two things.
@JsExport
annotation to your model data class and usevar
’s instead of val. This works only with simple data classes.serializer = Test.serializer()
parameter to your tabulator construtor/builder. It should work even with complex classes.Or, when your model class is serializable, you can pass serializer = Test.serializer() parameter to your tabulator construtor/builder. It should work even with complex classes.
Thanks, it works! Thanks again for the KVision!