micronaut-projects / micronaut-serialization

Build Time Serialization APIs for Micronaut
Apache License 2.0
26 stars 19 forks source link

Error while serializing objects created with @SerdeImport #837

Closed spyroid closed 4 months ago

spyroid commented 4 months ago

Expected Behavior

http://localhost:8080/p1 - should return a Product class in JSON format http://localhost:8080/p2 - should return a Product2 record in JSON format

Actual Behaviour

http://localhost:8080/p1 throws an error java.lang.NoSuchMethodError: 'double com.example.Product.getPrice()' http://localhost:8080/p2 returns an empty JSON object

Steps To Reproduce

No response

Environment Information

JDK 17,21

Example Application

https://github.com/spyroid/demoapp

Version

4.4.2

sdelamo commented 4 months ago

It is a ksp issue. I created a fork of your repo. I added a test and it passes when using KAPT https://github.com/spyroid/demoapp/pull/1

spyroid commented 4 months ago

It is a ksp issue. I created a fork of your repo. I added a test and it passes when using KAPT spyroid/demoapp#1

Thanks. Do I need to raise an issue ticket for KSP ?

sdelamo commented 4 months ago

It is a ksp issue. I created a fork of your repo. I added a test and it passes when using KAPT spyroid/demoapp#1

Thanks. Do I need to raise an issue ticket for KSP ?

No, this issue suffices.