Coder Social home page Coder Social logo

Comments (7)

yschimke avatar yschimke commented on May 31, 2024

From https://www.dropbox.com/developers/documentation/http/documentation#sharing-create_shared_link_with_settings

from jsontokotlinclass.

yschimke avatar yschimke commented on May 31, 2024

FYI I also raised as a suggestion on https://github.com/wuseal/JsonToKotlinClass

from jsontokotlinclass.

Mighty16 avatar Mighty16 commented on May 31, 2024

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.

yschimke avatar yschimke commented on May 31, 2024

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.

yschimke avatar yschimke commented on May 31, 2024

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.

Mighty16 avatar Mighty16 commented on May 31, 2024

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.

yschimke avatar yschimke commented on May 31, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.