diff --git a/json.go b/json.go index 4079182..0a1bb4a 100644 --- a/json.go +++ b/json.go @@ -10,6 +10,11 @@ func (x xmlNameJSONTypeNode) MarshalJSON() ([]byte, error) { return []byte(`"node"`), nil } +func (x *xmlNameJSONTypeNode) UnmarshalJSON(data []byte) error { + *x = xmlNameJSONTypeNode{} + return nil +} + // xmlNameJSONTypeWay is kind of a hack to encode the proper json // object type attribute for this struct type. type xmlNameJSONTypeWay xml.Name @@ -18,6 +23,11 @@ func (x xmlNameJSONTypeWay) MarshalJSON() ([]byte, error) { return []byte(`"way"`), nil } +func (x *xmlNameJSONTypeWay) UnmarshalJSON(data []byte) error { + *x = xmlNameJSONTypeWay{} + return nil +} + // xmlNameJSONTypeRel is kind of a hack to encode the proper json // object type attribute for this struct type. type xmlNameJSONTypeRel xml.Name @@ -26,6 +36,11 @@ func (x xmlNameJSONTypeRel) MarshalJSON() ([]byte, error) { return []byte(`"relation"`), nil } +func (x *xmlNameJSONTypeRel) UnmarshalJSON(data []byte) error { + *x = xmlNameJSONTypeRel{} + return nil +} + // xmlNameJSONTypeCS is kind of a hack to encode the proper json // object type attribute for this struct type. type xmlNameJSONTypeCS xml.Name @@ -34,6 +49,11 @@ func (x xmlNameJSONTypeCS) MarshalJSON() ([]byte, error) { return []byte(`"changeset"`), nil } +func (x *xmlNameJSONTypeCS) UnmarshalJSON(data []byte) error { + *x = xmlNameJSONTypeCS{} + return nil +} + // xmlNameJSONTypeUser is kind of a hack to encode the proper json // object type attribute for this struct type. type xmlNameJSONTypeUser xml.Name @@ -42,6 +62,11 @@ func (x xmlNameJSONTypeUser) MarshalJSON() ([]byte, error) { return []byte(`"user"`), nil } +func (x *xmlNameJSONTypeUser) UnmarshalJSON(data []byte) error { + *x = xmlNameJSONTypeUser{} + return nil +} + // xmlNameJSONTypeNote is kind of a hack to encode the proper json // object type attribute for this struct type. type xmlNameJSONTypeNote xml.Name @@ -49,3 +74,8 @@ type xmlNameJSONTypeNote xml.Name func (x xmlNameJSONTypeNote) MarshalJSON() ([]byte, error) { return []byte(`"note"`), nil } + +func (x *xmlNameJSONTypeNote) UnmarshalJSON(data []byte) error { + *x = xmlNameJSONTypeNote{} + return nil +}