Decimals represented in scientific notation cannot be rendered in YAML rendered #1134
Labels
bug
Something isn't working
fix confirmation pending
issue has been fixed and confirmation from issue reporter is pending
Describe the bug
Renderer cannot represent numbers written in scientific notation.
To Reproduce
Use a validator using decimal.Decimal with a least 7 decimals. Starting at 7 decimals, numbers will get printed in scientific notation (eg. 1E-7)
The resulting YAML will look like
!!int '1E-7'
and an error will be generated in Redoc viewcannot resolve a node with !<tag:yaml.org,2002:int> explicit tag
Expected behavior
The value should be
0.0000001
in the yaml file.It looks like the issue comes from the following method where the
str
method is used. Maybe a format would workvalue = '{:f}'.format(data)
Thank you in advance
The text was updated successfully, but these errors were encountered: