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

Python fromJsonString fails when integer is used instead of float #490

Open
Mi-La opened this issue Mar 20, 2023 · 0 comments
Open

Python fromJsonString fails when integer is used instead of float #490

Mi-La opened this issue Mar 20, 2023 · 0 comments
Labels
bug Something isn't working python Python language generator
Milestone

Comments

@Mi-La
Copy link
Contributor

Mi-La commented Mar 20, 2023

package sample;

struct Data
{
    uint32 id;
    float32 flt;
};
import zserio
import sample.api as sample

data = sample.Data(13, 0)
json = zserio.to_json_string(data)

zserio.from_json_string(sample.Data, json) # raises exception!

ZserioTreeCreator: Unexpected value type '<class 'int'>', expecting '<class 'float'>'! (JsonParser:3:12)

Try online!

@Mi-La Mi-La added the bug Something isn't working label Mar 20, 2023
@Mi-La Mi-La added this to the Backlog milestone Mar 20, 2023
@mikir mikir changed the title Python fromJsonString fails when interger is used instead of float Python fromJsonString fails when integer is used instead of float Mar 20, 2023
@mikir mikir added the python Python language generator label Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python Python language generator
Projects
None yet
Development

No branches or pull requests

2 participants