Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The getAvailableSizes cause JsonSyntaxException #122

Open
imarsv opened this issue Jul 8, 2022 · 0 comments
Open

The getAvailableSizes cause JsonSyntaxException #122

imarsv opened this issue Jul 8, 2022 · 0 comments

Comments

@imarsv
Copy link

imarsv commented Jul 8, 2022

V2.17 Release

The getAvailableSizes cause JsonSyntaxException

com.myjeeva.digitalocean.impl.DigitalOceanClient: Error occurred while parsing response
com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: Expected a long but was 0.5 at line 1 column 87 path $.sizes[0].transfer
	at com.google.gson.internal.bind.TypeAdapters$11.read(TypeAdapters.java:320)
	at com.google.gson.internal.bind.TypeAdapters$11.read(TypeAdapters.java:310)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:130)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:221)
	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)
	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:130)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:221)
	at com.google.gson.Gson.fromJson(Gson.java:991)
	at com.google.gson.Gson.fromJson(Gson.java:956)
	at com.google.gson.Gson.fromJson(Gson.java:905)
	at com.google.gson.Gson.fromJson(Gson.java:876)
	at com.myjeeva.digitalocean.impl.DigitalOceanClient.perform(DigitalOceanClient.java:1614)
	at com.myjeeva.digitalocean.impl.DigitalOceanClient.getAvailableSizes(DigitalOceanClient.java:798)

Original Json example

{
  "sizes": [
    {
      "slug": "s-1vcpu-512mb-10gb",
      "memory": 512,
      "vcpus": 1,
      "disk": 10,
      "transfer": 0.5,
      "price_monthly": 4,
      "price_hourly": 0.00595,
      "regions": [
        "ams3",
        "fra1",
        "nyc1",
        "sfo3",
        "sgp1"
      ],
      "available": true,
      "description": "Basic"
    },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant