-
Notifications
You must be signed in to change notification settings - Fork 49
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
Unmarshaling of Overpass JSON fails on version field #44
Comments
the osm website does it as a string https://www.openstreetmap.org/api/0.6/node/1.json so I guess it needs to be |
Right, good idea! And https://github.com/paulmach/osm/blob/master/osm.go#L302 could become o.Version = fmt.Sprint(s.Version) Alternatively a type-switch to get around any IEEE754 weirdness switch x:=s.Version.(type) {
case float64:
o.Version = fmt.Sprintf("%.1f", x.Version)
case string:
o.Version = x |
Seeing the same issue, I used this overpass query string
|
PR to fix this #46 |
Merged and published v0.7.1 Thank you for reporting this issue. |
The version information is encoded as JSON number instead of a string by Overpass API. This causes unmarshaling it to fail with error
json: cannot unmarshal number into Go struct field .version of type string
Take, for example, the minimal JSON output of overpass (http://overpass-api.de/api/interpreter?data=[out:json];out;), e.g.
Minimum viable example failure: https://go.dev/play/p/n7kBY3CCbHC
The text was updated successfully, but these errors were encountered: