Hi Manudeep,
To your two points:
- Yes - it is completely fine to use filter criteria in a GET to narrow the range of responses. The TMForum API Design Guidelines mention this. However I think you would achieve your example "
customerBill?filter=billingAccount.id=in=('ACC-001','ACC-002')" as "customerBill?billingAccount.id=ACC-001&billingAccount.id=ACC-002".
The design guidelines use a similar example of "GET /resourceInventoryManagement/logicalResource?id=42&id=44" - so retrieving a collection using multiple ids is fine.
- For your date range example, I would probably try JSON-Path expression syntax which gives you operators (
>, >=, != etc) and functions (min(), avg(), sum() etc). JSON-Path is mentioned as the defacto expression syntax in various places in the design guidelines.
Regarding your point about:
is it ok to use characteristic in response? there is no such field in the specifications? what is best way to implement such fields which are not available in SID schema?
It is very much recognised that the TMF schemas present a generic framework that might have wide applicability to many use-cases, but if you want to add properties specific to your internal interactions (like your DISPUTEAMOUNT), you can always extend the TMF schemas. This is typically done by adding a new schema to the definitions section of the TMF swagger, called (say) CustomerBillExtended, looking a bit like this:
"definitions": {
"CustomerBillExtended": {
"allOf": [
{
"$ref": "#/definitions/CustomerBill"
},
{
"type": "object",
"properties": {
"disputedAmount": {
"type": "string",
"description": "The amount being disputed on the customer bill",
"pattern": "^[0-9]+\\.[0-9]{2}"
}
}
}
]
}
}
Then you can fiddle with the existing operations to accept and return a CustomerBillExtended rather than a CustomerBill. The resultant API will be compatible with the TMF original, and would still pass a TMF Conformance Test Kit (CTK), which would only test for mandatory properties from the original. It will ignore any additional properties.
------------------------------
Stephen Harrop
Principal Integration Architect
Vodafone Group
------------------------------