Hi,
I think TMF has nothing to do with jsonpath.But you can figure out right expression using evaluators on TMF 639 json structure.
Probably using
https://jsonpath.com/Example expression for you would be like below
$.resourceCharacteristic[?(@.name=="premiumValue")]
JSON Data:
{
"id": "444",
"href": "http://server:port/resourceInventoryManagement/logicalResource/444",
"description": "This is a MSISDN resource with the category Premium and with an unlocked administrativeState.",
"category": "Premium",
"value": "0170123456",
"administrativeState": "unlocked",
"operationalState": "disable",
"usageState": "idle",
"resourceStatus": "available",
"resourceSpecification": {
"id": "4",
"href": "
http://server:port/resourceCatalogManagement/resourceSpecification/4","@referredType": "LogicalResourceSpecification"
},
"resourceCharacteristic": [
{
"name": "premiumValue",
"valueType": "string",
"value": "gold"
},
{
"name": "nonPremiumValue",
"valueType": "string",
"value": "silver"
}
],
"relatedParty": [
{
"href": "https://server:port/tmf-api/partyManagement/v4/individual/456",
"id": "456",
"name": "John Doe",
"role": "user",
"@referredType": "Individual"
}
],
"@type": "MSISDN",
"@schemaLocation": "http://server:port/MSISDN.schema.json",
"@baseType": "Resource"
}
Hope this helps.
------------------------------
Hanumantha Marikanti
Saralam Technologies
------------------------------
Original Message:
Sent: Jul 05, 2022 03:15
From: Eric Gomdjim
Subject: TMF Filter for an attribut that is an array of objects e.g TMF 639 resourceCharacteristic
What is the best way in TMF to filter for an attribute that is a list of objects?
We have the requirement to provide a filter that allows the customer to filter by properties of objects in an array.
In this case, TMF 639 must be filtered according to the name and the value of resourceCharacteristic.
What is the best way to archive this purpose with jsonpath for example?
Is the following example a TMF conform filter for searching collections?
GET /resource?resourceCharacteristic=[{"name":"<characteristic1 name>","value":"<characteristic1 value>"} ,{"name":"characteristic2 name","value":"<characteristic2 value>"}]
see also https://higherlogicdownload.s3-external-1.amazonaws.com/TMFORUM/d2c768e1-b073-4859-9e96-50e00658c8d0_file.pdf?AWSAccessKeyId=AKIAVRDO7IEREB57R7MT&Expires=1657025394&Signature=HiBHlE3Cmhg3cnnjAZhxfziYQyM%3D
------------------------------
Eric Gomdjim
Deutsche Telekom AG
------------------------------