JsonToKotlinClass
JsonToKotlinClass copied to clipboard
Imports only used in root class
I have a project where there is a need to do imports in only the root class and then not use these imports in the sub classes within each class. An example can be see below. I can change the core of the project to make this possible but can't seem to do it with just creating an extension. Is this possible to do without changing the core of the plugin?
FROM THIS:
"RootClass": { "rootClassId": "001", "subClass": { "subClassId": "001", "value": "1" } }
TO THIS:
data class RootClass( val id: String, val subClass: SubClass ) : RootObject
data class SubClass( val subClassId: String, val value: String ) : Serializable
@ViktorIngemarsson Hey. What's the imports
Its project specific but could be as in the example above that I want to extend different classes depending on if its the root class or not; RootObject or Serializable
@ViktorIngemarsson sorry, we can't determine if it is root class when code only inside the Extension
class currently
@ViktorIngemarsson in this case, I think we need to refactor the current code logic for more accesses
I anticipated that, thanks for the quick answer!