Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions json.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -42,10 +62,20 @@ 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

func (x xmlNameJSONTypeNote) MarshalJSON() ([]byte, error) {
return []byte(`"note"`), nil
}

func (x *xmlNameJSONTypeNote) UnmarshalJSON(data []byte) error {
*x = xmlNameJSONTypeNote{}
return nil
}