Compare commits

...

2 Commits

Author SHA1 Message Date
a75b1291cb v0.0.250
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 51s
2023-08-21 15:34:27 +02:00
21cd1ee066 v0.0.249 better MDTAny json serialization
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 54s
2023-08-21 15:19:40 +02:00
2 changed files with 14 additions and 3 deletions

View File

@@ -612,7 +612,18 @@ func (v MetaValue) rawValueForJson() any {
if v.Value.(AnyWrap).IsNil {
return nil
}
return v.Value.(AnyWrap).Serialize()
if v.Value.(AnyWrap).IsError {
return bson.M{"@error": true}
}
jsonobj := primitive.M{}
jsonarr := primitive.A{}
if err := json.Unmarshal([]byte(v.Value.(AnyWrap).Json), &jsonobj); err == nil {
return jsonobj
} else if err := json.Unmarshal([]byte(v.Value.(AnyWrap).Json), &jsonarr); err == nil {
return jsonarr
} else {
return bson.M{"type": v.Value.(AnyWrap).Type, "data": v.Value.(AnyWrap).Json}
}
}
if v.DataType == MDTID {
if v.Value.(IDWrap).IsNil {

View File

@@ -1,5 +1,5 @@
package goext
const GoextVersion = "0.0.248"
const GoextVersion = "0.0.250"
const GoextVersionTimestamp = "2023-08-21T15:08:35+0200"
const GoextVersionTimestamp = "2023-08-21T15:34:26+0200"