Home > Mobile >  How to read json variable "@odata.context" in Java using Gson?
How to read json variable "@odata.context" in Java using Gson?

Time:06-28

In Json, i have following

{  "@odata.context":"https://te.avolutionsoftware.com/api/$metadata#Components/$entity"

When i translate Json to java i get following:

private String @odata.context;

and compiler is not allowing that.

Any idea how to read this variable particularly in Gson library or in general what to search?

CodePudding user response:

@SerializedName might help you . like this:

public final class Context {
        @SerializedName("@odata.context")
        public String context;
    
    }

  • Related