haskell / aeson

A fast Haskell JSON library
Other
1.26k stars 321 forks source link

Need an option to cast string to int #990

Open yaitskov opened 1 year ago

yaitskov commented 1 year ago

Hi,

I upgrade aeson to version 2.0.3.0 and gogol-1.0 fails because data type has an int64 field, but value is "0"

    inputStages :: (Core.Maybe [Core.Int64]),
  }  deriving (Core.Eq, Core.Show, Core.Generic)
phadej commented 1 year ago

I don't understand the issue.

Is this a regression between aeson-1.5 and aeson-2.0? I don't think so, as aeson never (AFAIK) accepted textual strings as numbers.

Neither you tell how decoding is done. Using generically derived instance?

In any case this seems like an issue in gogol.