feat: loosen the type restrictions on attr.Json
				
					
				
			Just like `json.Marshal` takes arguments of `any` type, the `attr.Json` should have similarly loose restrictions on input type.
This commit is contained in:
		@@ -142,7 +142,7 @@ func JsonAttr(key string, jsonEl map[string]interface{}) attribute.KeyValue {
 | 
			
		||||
 | 
			
		||||
// Create an arbitrary attribute with value marshalled to json.
 | 
			
		||||
// In case of marshalling error, it is returned in place of value.
 | 
			
		||||
func Json[M json.Marshaler](key string, val M) attribute.KeyValue {
 | 
			
		||||
func Json(key string, val any) attribute.KeyValue {
 | 
			
		||||
	data, err := json.Marshal(val)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return attribute.KeyValue{Key: attribute.Key(key), Value: attribute.StringValue(err.Error())}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user