Closed GneyHabub closed 7 months ago
The the JSON value can be null, the struct should have a pointer to the geojson.Feature
type SetSiteGeocageRequest struct {
Geocage *geojson.Feature `json:"geocage"`
}
I can update to support this as I'm dealing with a similar problem at work right now and it's super annoying, but in the mean-time you can do the above.
I am trying to unmarshall a json string into a struct that has a field of type geojson.Feature. If this field is present in the json object, but is
null
, then the orb package panics when trying to unmarshall it. Here is the error message:The struct I was trying to unmarshall the json into is the following:
And the json string looked like this: