whosonfirst / go-whosonfirst-export

Go package for exporting Who's On First documents.
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Explicity convert and assign existing "wof:id" properties to be int64 #31

Open thisisaaronland opened 3 months ago

thisisaaronland commented 3 months ago

Basically here:

https://github.com/whosonfirst/go-whosonfirst-export/blob/main/properties/wofid.go#L24-L27

Note that the way the code is written the gjson response will happily convert a value of "1234" to be 1234 when calling the Int() method. So, basically we want to derive the int value, ensure that it's not 0 and then explicitly call sjson.SetBytes to ensure that wof:id is an integer value.

Background: https://github.com/whosonfirst-data/whosonfirst-data/issues/2208