Closed mgomes closed 1 month ago
Here is a minimally reproducible example of the issue I am running into:
package main import ( "fmt" "log" "github.com/aws/aws-sdk-go-v2/service/bedrockruntime/document" ) func main() { doc := document.NewLazyDocument(map[string]interface{}{ "param1": "value1", }) var result map[string]interface{} err := doc.UnmarshalSmithyDocument(&result) if err != nil { log.Fatalf("Error unmarshalling Smithy document: %v", err) } fmt.Printf("Unmarshalled result: %+v\n", result) }
Running this code produces the error: Error unmarshalling Smithy document: unsupported json type, *map[string]interface {}
Error unmarshalling Smithy document: unsupported json type, *map[string]interface {}
Is NewLazyDocument storing the map as a pointer internally somehow and so it isn't getting recognized? It seems like it should work when looking at the decoder: https://github.com/aws/smithy-go/blob/main/document/json/decoder.go#L71.
NewLazyDocument
Closing this, I opened up the issue in the aws-sdk instead: https://github.com/aws/aws-sdk-go-v2/issues/2751
Here is a minimally reproducible example of the issue I am running into:
Running this code produces the error:
Error unmarshalling Smithy document: unsupported json type, *map[string]interface {}
Is
NewLazyDocument
storing the map as a pointer internally somehow and so it isn't getting recognized? It seems like it should work when looking at the decoder: https://github.com/aws/smithy-go/blob/main/document/json/decoder.go#L71.