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

Remote API shouldn't convert ints to floats in JSON output #6246

Closed
ammmir opened this issue Jun 7, 2014 · 1 comment · Fixed by #6659
Closed

Remote API shouldn't convert ints to floats in JSON output #6246

ammmir opened this issue Jun 7, 2014 · 1 comment · Fixed by #6659
Labels
area/api kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.

Comments

@ammmir
Copy link

ammmir commented Jun 7, 2014

when the remote api returns numbers in its JSON response, they seem to be marshaled into floats instead of ints when the number is big enough (in docker inspect for example):

[{
    "Config": {
        "Memory": 6.7108864e+07,
        ...
    },
    ...
}]

they should instead be returned as ints, like 67108864 above, and respect the definition in the relevant struct.

the current output is valid JSON, but it's cumbersome to work with using json.Unmarshal without setting up a decoder and using d.UseNumber(), etc.

@LK4D4
Copy link
Contributor

LK4D4 commented Jun 7, 2014

@ammir I tried to fix this in #6248. You could try my branch if you have enough time :)

vieux pushed a commit to vieux/docker that referenced this issue Jun 24, 2014
Fixes moby#6246
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
@thaJeztah thaJeztah added area/api kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. labels Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
Projects
None yet
3 participants