-
Notifications
You must be signed in to change notification settings - Fork 80
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
fix: integer fields are displayed as floats when using describe
with o=yaml
#638
Labels
Comments
phm07
changed the title
Integer fields are displayed as floats in YAML output
fix: integer fields are displayed as floats when using Dec 19, 2023
describe
with o=yaml
phm07
added a commit
that referenced
this issue
Dec 19, 2023
phm07
added a commit
that referenced
this issue
Dec 19, 2023
The same is true for |
phm07
added a commit
that referenced
this issue
Dec 20, 2023
…yaml (#651) Continuation #650, closes #638 When outputting a resource after creation, it is first converted into a schema struct. This fixes bugs like #638 and also makes all schema outputs (describe, list, create) consistent. --------- Co-authored-by: jo <[email protected]>
jooola
pushed a commit
that referenced
this issue
Dec 21, 2023
🤖 I have created a release *beep* *boop* --- ## [1.41.1](v1.41.0...v1.41.1) (2023-12-21) ### Bug Fixes * allow multiple --type flags for metrics commands ([#649](#649)) ([69346f7](69346f7)), closes [#642](#642) * integer fields are displayed as floats when using create with o=yaml ([#651](#651)) ([2d42fcd](2d42fcd)) * integer fields are displayed as floats when using describe with -o=yaml ([#650](#650)) ([ee4c51e](ee4c51e)), closes [#638](#638) * wording when metrics are not yet available ([#639](#639)) ([9298c46](9298c46)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When outputting resources in YAML format using
describe
, some integer fields (like IDs) are interpreted as floating point numbers and are thus unusable. Example output of$ hcloud image describe fedora-39 -o=yaml
:This is because when running
describe
, the API response is decoded into amap[string]any
. The Gojson
library defaults tofloat64
when converting JSON number literals into anany
, so in the encoding back to YAML these integer fields are interpreted as floats.The text was updated successfully, but these errors were encountered: