-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kotlin code using inheritance with an abstract class doesn't serialize abstract class field #173
Comments
Pattern like this seems to work
It would be of great help if someone invested some time and setup a Maven project for testing Kotlin: #158 |
@zapov I created a maven project that will illustrate the issue find it here I noticed a warning about tools.jar not found, there is this issue regarding this warning but according to jetbrains it was fixed. Maybe dsl-json is referencing tools.jar in some way ? For some reason gradle plugin doesn't show this warning !!! |
Hi @abnud1 It would be great if someone can make: https://github.com/ngs-doo/dsl-json/tree/kotlin-tests runnable I can come closer by doing some hacks, eg putting Kotlin files in main instead of tests, but still it fails due to some dependency problem which I don't really have time to look into. If you can make that branch compiling and tests running that would be a great start for improved Kotlin support |
@zapov I'll try and see If I can make those tests running |
Well And the process is unfortunately very confusing, you have to execute test on parent project not submodule, if you don't want to test all the modules you use I'll have to see later why the test isn't run even though maven show no errors at all, even with simple |
I'm fine with writing Java code for tests which uses Kotlin classes. If you can get that to work via mvn test that should be more than good enough |
This should now work as "expected". Please look over and report back :) Also finally managed to setup Kotlin tests, so it should be easier to resolve such cases in the future 🎉 |
v1.9.6 released |
We have a kotlin backend project, We're using dsl-json as the JSON serialization library and we have code similar to this:
The problem that happens is that when serializing B object t property in A class is not serialized, By looking at the generated code We see no trace for the t property.
We tried multiple configuration options for
@CompiledJson
annotation likeminified = false
, changing include policy, We even usedJsonAttribute
annotation like this:But to no avail, here is how We configure the DslJson instance:
We tried multiple things at this code, again nothing works.
Here is full code with example serializing code:
we're using the latest version of dsl-json, kotlin is at 1.4, we're using kapt annotation processor
and gradle 6.6.
OS is Windows 10 x64
Java version is 11
The text was updated successfully, but these errors were encountered: