Comments (7)
from jsontokotlinclass.
FYI I also raised as a suggestion on https://github.com/wuseal/JsonToKotlinClass
from jsontokotlinclass.
Hi! Did you use the latest version of plugin? I tried to convert json from your link and got slightly different result:
data class RevokeFailureReason(@Json(name = ".tag")
val Tag: String = "")
data class TeamMemberInfo(@Json(name = "member_id")
val memberId: String = "",
@Json(name = "team_info")
val teamInfo: TeamInfo,
@Json(name = "display_name")
val displayName: String = "")
data class ResolvedVisibility(@Json(name = ".tag")
val Tag: String = "")
data class TeamInfo(@Json(name = "name")
val name: String?,
@Json(name = "id")
val id: String?)
data class TestClass(@Json(name = "team_member_info")
val teamMemberInfo: TeamMemberInfo,
Json(name = "path_lower")
val pathLower: String = "",
@Json(name = "name")
val name: String = "",
@Json(name = "link_permissions")
val linkPermissions: LinkPermissions,
@Json(name = ".tag")
val Tag: String = "",
@Json(name = "id")
val id: String = "",
@Json(name = "url")
val url: String = "")
data class LinkPermissions(@Json(name = "can_revoke")
val canRevoke: Boolean = false,
@Json(name = "resolved_visibility")
val resolvedVisibility: ResolvedVisibility,
@Json(name = "revoke_failure_reason")
val revokeFailureReason: RevokeFailureReason)
You can choose to use optional value and set its default value as null if you need.
from jsontokotlinclass.
Yep - this was my point, instead of this
@Json(name = "revoke_failure_reason")
val revokeFailureReason: RevokeFailureReason)
I was hoping for
val revoke_failure_reason: RevokeFailureReason)
from jsontokotlinclass.
This is a low priority feature request, feel free to close. n.b. In Moshi you only need the @JSON when names don't match
from jsontokotlinclass.
Ok, you can double click on "Field name" column item and rename specific field if you need but annotations will be added I think. I used annotations only when names don't match at first, but then changed to use it everywhere. I will think about an option for this case
from jsontokotlinclass.
The main reason I was hoping for this is if it's automatic with a supported mode then I would use it a lot. If I need to configure, I would probably just write the classes myself.
Thanks
from jsontokotlinclass.
Related Issues (7)
- I don't see the option to generate the classes HOT 1
- java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable()' on a null object reference
- react-native 空指针报错
- Imported JSONtoKotlinClass.jar. But when I try to generate data class it is throwing ClassNotFound exception.
- how to disable set default value ?
- Numbers in JSON Are Removed In Target Name
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsontokotlinclass.