PR feedback
This commit is contained in:
parent
3d07de0535
commit
2a35a7283a
|
@ -361,6 +361,9 @@ func UnmarshalPropertyValue(v *structpb.Value, opts MarshalOptions) (*resource.P
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("malformed RPC resource: missing urn")
|
return nil, errors.New("malformed RPC resource: missing urn")
|
||||||
}
|
}
|
||||||
|
if !urn.IsString() {
|
||||||
|
return nil, errors.New("malformed RPC resource: urn not a string")
|
||||||
|
}
|
||||||
r := resource.NewResourceProperty(resource.Resource{Urn: urn})
|
r := resource.NewResourceProperty(resource.Resource{Urn: urn})
|
||||||
return &r, nil
|
return &r, nil
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -506,8 +506,8 @@ export function deserializeProperty(prop: any): any {
|
||||||
value: deserializeProperty(prop["value"]),
|
value: deserializeProperty(prop["value"]),
|
||||||
};
|
};
|
||||||
case specialResourceSig:
|
case specialResourceSig:
|
||||||
|
// Deserialize the resource into a live Resource reference
|
||||||
const urn = prop["urn"];
|
const urn = prop["urn"];
|
||||||
// If this value is a URN, create a proxy wrapper around it.
|
|
||||||
const urnParts = urn.split("::");
|
const urnParts = urn.split("::");
|
||||||
const qualifiedType = urnParts[2];
|
const qualifiedType = urnParts[2];
|
||||||
const type = qualifiedType.split("$").pop()!;
|
const type = qualifiedType.split("$").pop()!;
|
||||||
|
|
Loading…
Reference in a new issue