You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the JsonApiX library to process models containing @HasMany relationships (e.g., mediaRelationships), the generated model class contains invalid Kotlin syntax. Specifically, the equality comparison == true in the .filter block causes a compilation error.
ℹ️ Environment
Environment
Android Studio Ladybug | 2024.2.1 Patch 3
Build #AI-242.23339.11.2421.12700392, built on November 22, 2024
Runtime version: 21.0.3+-12282718-b509.11 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 10.0
Kotlin plugin: K2 mode (Beta)
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4096M
Cores: 4
Registry:
ide.instant.shutdown=false
ide.experimental.ui=true
i18n.locale=
Sure. Thanks for your efforts and for creating this wonderful library which makes developers' lives easier.
Anyways, when I press backspace before the generated code == (where the warning is being shown), the warning disappears in the generated code as well. I'm not sure why the generated code doesn’t have issues with the genre and character classes but only produces this bug with the media relationships class.
I'm also new to using the JSON-API standard, so I apologize if I made any mistakes. Please feel free to guide me if I made any errors in setting up the model classes.🙏🏻🤞🏻
📖 Description
Description
When using the
JsonApiX
library to process models containing@HasMany
relationships (e.g.,mediaRelationships
), the generated model class contains invalid Kotlin syntax. Specifically, the equality comparison== true
in the.filter
block causes a compilation error.ℹ️ Environment
Environment
Android Studio Ladybug | 2024.2.1 Patch 3
Build #AI-242.23339.11.2421.12700392, built on November 22, 2024
Runtime version: 21.0.3+-12282718-b509.11 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 10.0
Kotlin plugin: K2 mode (Beta)
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4096M
Cores: 4
Registry:
ide.instant.shutdown=false
ide.experimental.ui=true
i18n.locale=
💣 Steps to reproduce
Reproduction Steps
Models
JsonApiX
.🔧 Expected behavior
Expected Behavior
The generated
ResourceObject_Anime
class should compile successfully and map themediaRelationships
correctly.Actual Behavior
The generated code includes invalid syntax in the
mediaRelationships
mapping logic, causing the following error:Generated Code Snippet
This occurs because of the redundant
== true
comparison within the.filter
block.Full Generated Class
📄 Additional information
Suggested Fix
== true
comparison in the generated code.HasMany
andHasOne
relationships are resolved correctly and consistently in the generated models.The text was updated successfully, but these errors were encountered: