The same code worked fine with 1.5 but now with 2.0 Flash we get JSON where numbers have meaningless extra decimals, varying between 50-5000.
We define the response using the C# SDK:
GenerationConfig = new GenerationConfig
(...)
ResponseMimeType = "application/json",
(...)
answerProperties.Add("myNumber", new OpenApiSchema { Type = GoogleAIType.Number });
I used to see cases with 0s but now apparently there is a variant with other numbers too. Often the JSON is still valid but when it’s this long, the response is cut and the JSON doesn’t parse. Also the number can be too big the JSON parser.
“myNumber”: 4.0000000000000018E-11501844417691393479307476841842741412655410513873128488222878430127453526784929218935855699911508047808723845408957314469123911503897788304219541431538701980380704997781126684882162341276074793452015715541701005948152710589126750950395234200026733332527581673882610856189914210128628278493162937773046652309675568637222856778348150886685809744983400444150858447267849292189358556999115080478087238454089573144691239115038977883042195414315387019803807049977811266848821623412760747934520157155417010059481527105891267509503952342000267333325275816738826108561899142101286282784931629377730466523096755686372228567783481508866858097449834004441508584472678492921893585569991150804780872384540895731446912391150389778830421954143153870198038070499778112668488216234127607479345201571554170100594815271058912675095039523420002673333252758167388261085618991421012862827849316293777304665230967556863722285677834815088668580974498340044415085844726784929218935855699911508047808723845408957314469123911503897788304219541431538701980380704997781126684882162341276074793452015715541701005948152710589126750950395234200026733332527581673882610856189914210128628278493162937773046652309675568637222856778348150886685809744983400444150858447267849292189358556999115080478087238454089573144691239115038977883042195414315387019803807049977811266848821623412760747934520157155417010059481527105891267509503952342000267333325275816738826108561899142101286282784931629377730466523096755686372228567783481508866858097449834004441508584472678492921893585569991150804780872384540895731446912391150389778830421954143153870198038070499778112668488216234127607479345201571554170100594815271058912675095039523420002673333252758167388261085618991421012862827849316293777304665230967556863722285677834815088668580974498340044415085844726784929218935855699911508047808723845408957314469123911503897788304219541431538701980380704997781126684882162341276074793452015715541701005948152710589126750950395234200026733332527581673882610856189914210128628278493162937773046652309675568637222856778348150886685809744983400444150858447267849292189358556999115080478087238454089573144691239115038977883042195414315387019803807049977811266848821623412760747934520157155417010059481527105891267509503952342000267333325275816738826108561899142101286282784931629377730466523096755686372228567783481508866858097449834004441508584472678492921893585569991150804780872384540895731446912391150389778830421954143153870198038070499778112668488216234127607479345201571554170100594815271058912675095039523420002673333252758167388261085618991421012862827849316293777304665230967556863722285677834815088668580974498340044415085844726784929218935855699911508047808723845408957314469123911503897788304219541431538701980380704997781126684882162341276074793452015715541701005948152710589126750950395234200026733332527581673882610856189914210128628278493162937773046652309675568637222856778348150886685809744983400444150858447267849292189358556999115080478087238454089573144691239115038977883042195414315387019803807049977811266848821623412760747934520157155417010059481527105891267509503952342000267333325275816738826108561899142101286282784931629377730466523096755686372228567783481508866858097449834004441508584472678492921893585569991150804780872384540895731446912391150389778830421954143153870198038070499778112668488216234127607479345201571554170100594815271058912675095039523420002673333252758167388261085618991421012862827849316293777304665230967556863722285677834815088668580974498340044415085844726784929218935855699911508047808723845408957314469123911503897788304219541431538701980380704997781126684882162341276074793452015715541701005948152710589126750950395234200026733332527581673882610856189914210128628278493162937773046652309675568637222856778348150886685809744983400444150858447267849292189358556999115080478087238454089573144691239115038977883042195414315387019803807049977811266848821623412760747934520157155417010059481527105891267509503952342000267333325275816738826108561899142101286282784931629377730466523096755686372228567783481508866858097449834004441508584472678492921893585569991150804780872384540895731446912391150389778830421954143153870198038070499778112668488216234127607479345201571554170100594815271058912675095039523420002673333252758167388261085618991421012862827849316293777304665230967556863722285677834815088668580974498340044415085844726784929218935855699911508047808723845408957314469123911503897788304219541431538701980380704997781126684882162341276074793452015715541701005948152710589126750950395234200026733332527581673882610856189914210128628278493162937773046652309675568637222856778348150886685809744983400444150858447267849292189358556999115080478087238454089573144691239115038977883042195414315387019803807049977811266848821623412760747934520157155417010059481527105891267509503952342000267333325275816738826108561899142101286282784931629377730466523096755686372228567783481508866858097449834004441508584472678492921893585569991150804780872384540895731446912391150389778830421954143153870198038070499778112668488216234127607479345201571554170100594815271058912675095039523420002673333252758167388261085618991421012862827849316293777304665230967556863722285677834815088668580974498340044415085844726784929218935855699911508047808723845408957314469123911503897788304219541431538701980380704997781126684882162341276074793452015715541701005948152710589126750950395234200026733332527581673882610856189914210128628278493162937773046652309675568637222856778348150886685809744983400444150858447267849292189358556999115080478087238454089573144691239115038977883042195414315387019803807049977811266848821623412760747934520157155417010059481527105891267509503952342000267333325275816738826108561899142101286282784931629377730466523096755686372228567783481508866858097449834004441508584472678492921893585569991150804780872384540895731446912391150389778830421954143153870198038070499778112668488216234127607479345201571554170100594815271058912675095039523420002673333252758167388261085618991421012862827849316293777304665230967556863722285677834815088668580974498340044415085844726784929218935855699911508047808723845408957314469123911503897788304219541431538701980380704997781126684882162341276074793452015715541701005948152710589126750950395234200026733332527581673882610856189914210128628278493162937773046652309675568637222856778348150886685809744983400444150858447267849292189358556999115080478087238454089573144691239115038977883042195414315387019803807049977811266848821623412760747934520157155417010059481527105891267509503952342000267333325275816738826108561899142101286282784931629377730466523096755686372228567783481508866858097449834004441508584472678492921893585569991150804780872384540895731446912391150389778830421954143153870198038070499778112668488216234127607479345201571554170100594815271058912675095039523420002673333252758167388261085618991421012862827849316293777304665230967556863722285677834815088668580974498340044415085844726784929218935855699911508047808723845408957314469123911503897788304219541431538701980380704997781126684882162341276074793452015715541701005948152710589126750950395234200026733332527581673882610856189914210128628278493162937773046652309675568637222856778348150886685809744983400444150858447267849292189358556999115080478087238454089573144691239115038977883042195414315387019803807049977811266848821623412760747934520157155417010059481527105891267509503952342000267333325275816738826108561899142101286282784931629377730466523096755686372228567783481508866858097449834004441508584472678492921893585569991150804780872384540895731446912391150389778830421954143153870198038070499778112668488216234127607479345201571554170100594815271058912675095039523420002673333252758167388261085618991421012862827849316293777304665230967556863722285677834815088668580974498340044415085844726784929218935855699911508047808723845408957314469123911503897788304219541431538701980380704997781126684882162341276074793452015715541701005948152710589126750950395234200026733332527581673882610856189914210128628278493162937773046652309675568637222