pojo parse gson with invalid java names

后端 未结 3 954
滥情空心
滥情空心 2021-01-04 03:51

i\'m working with the youtube json from google-api-client :

{
    \"apiVersion\": \"2.0\",
    \"data\": {
        \"updated\": \"2011-01-05T13:48:33.146Z\",         


        
3条回答
  •  粉色の甜心
    2021-01-04 04:25

    If you're using the @Key annotation for your mapped fields, you just need to make use of a custom value that can be passed to this annotation. So choose a legal name for your field and map it as @Key("default"):

    @Key("default")
    private String defaultUrl;
    

提交回复
热议问题