If you try to create a datapackage that contains a resource with a large number of bytes using the FromString method, it errors with:
Error: I[#] S[#] doesn't validate with "data-package#" I[#/resources/0/bytes] S[#/properties/resources/items/properties/bytes/type] expected integer, but got number
Here's some basic code that should make it happen:
I know this repo hasn't seen activity in a while, but this is a pretty serious bug. At best it means you can't use the bytes key (my workaround will be to use a size key instead), at worst it creates a hidden bug if you only test your code on small files.
Please preserve this line to notify @danielfireman (lead of this repository) @roll
Overview
JSON doesn't differentiate between floats and integers. When parsed from JSON, large integers get converted into scientific notation (https://stackoverflow.com/questions/22343083/json-unmarshaling-with-long-numbers-gives-floating-point-number), for example:
17747417 -> 1.7747417e+07
If you try to create a datapackage that contains a resource with a large number of bytes using the FromString method, it errors with:
Here's some basic code that should make it happen:
Using datapackage string:
I know this repo hasn't seen activity in a while, but this is a pretty serious bug. At best it means you can't use the bytes key (my workaround will be to use a
size
key instead), at worst it creates a hidden bug if you only test your code on small files.Please preserve this line to notify @danielfireman (lead of this repository) @roll