You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When unmarshaling a CBOR item into a Go interface{} value, and the item has an unrecognized tag number, the concrete object stored in the interface{} value is a cbor.Tag{} struct. In our project, there is a need to unmarshal CBOR into map[string]interface{} so that it can be used in places currently using encoding/json. The existing code that unmarshals JSON into map[string]interface{} and processes it, expects to deal with concrete values of certain types (bool, float64, string, []interface{}, map[string]interface{}, or nil). To achieve compatibility with the current code that uses encoding/json, there's a need to configure cbor's decode operation so that when it decodes an unrecognized tag into interface{}, it ignores the tag.
Describe the solution you'd like
Add a new decode option to make the behavior of ignoring unrecognized tags when unmarshaling into interface{} configurable. The option would allow compatibility with existing code that assumes decoding into interface{} produces something compatible with the encoding/json behavior.
Additional context
I'd be happy to contribute the changes needed for this issue.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
When unmarshaling a CBOR item into a Go interface{} value, and the item has an unrecognized tag number, the concrete object stored in the interface{} value is a cbor.Tag{} struct. In our project, there is a need to unmarshal CBOR into map[string]interface{} so that it can be used in places currently using encoding/json. The existing code that unmarshals JSON into map[string]interface{} and processes it, expects to deal with concrete values of certain types (bool, float64, string, []interface{}, map[string]interface{}, or nil). To achieve compatibility with the current code that uses encoding/json, there's a need to configure cbor's decode operation so that when it decodes an unrecognized tag into interface{}, it ignores the tag.
Describe the solution you'd like
Add a new decode option to make the behavior of ignoring unrecognized tags when unmarshaling into interface{} configurable. The option would allow compatibility with existing code that assumes decoding into interface{} produces something compatible with the encoding/json behavior.
Additional context
I'd be happy to contribute the changes needed for this issue.
The text was updated successfully, but these errors were encountered: