FIWARE-TMForum / Business-API-Ecosystem

The FIWARE/TMForum Business API Ecosystem allows the monetization of different kind of assets (both digital and physical) during the whole service life cycle, from offering creation to its charging, accounting and revenue settlement and sharing
https://business-api-ecosystem.rtfd.io/
GNU Affero General Public License v3.0
38 stars 22 forks source link

Inventory productSpecification not shown when calling /DSProductInventory/api/productInventory/v2/product #12

Closed emepetres closed 3 years ago

emepetres commented 6 years ago

In version 5.4.1, when calling http API /DSProductInventory/api/productInventory/v2/product, response doesn't show the field 'productSpecification' inside each offering. Example response at the bottom.

I think this is a bug, how I could fix it?

I know there is a new version, but I can't update at this moment and I'd like to fix it on 5.4.1.

Example:

[
    {
        "id": 112,
        "href": "http://localhost:8080/DSProductInventory/api/productInventory/v2/product/112",
        "name": " oid=227",
        "status": "Active",
        "startDate": "2018-04-26T09:51:27Z",
        "orderDate": null,
        "terminationDate": null,
        "productOffering": {
            "id": "351",
            "href": "http://193.144.35.147:8000/DSProductCatalog/api/catalogManagement/v2/catalog/165/productOffering/351:(0.1)"
        },
        "productCharacteristic": [
            {
                "name": "BLUEPRINT_PATH",
                "value": "https://github.com/MSO4SC/resources/blob/master/blueprint-examples/single-singularity-job.tar.gz?raw=true"
            }
        ],
        "productRelationship": [],
        "billingAccount": [
            {
                "id": "109",
                "href": "http://193.144.35.147:8000/DSBillingManagement/api/billingManagement/v2/billingAccount/109"
            }
        ],
        "relatedParty": [
            {
                "id": "jcarnerodev",
                "role": "Customer",
                "href": "http://193.144.35.147:8000/DSPartyManagement/api/partyManagement/v2/individual/jcarnerodev"
            },
            {
                "id": "jcarnero",
                "role": "Seller",
                "href": "http://193.144.35.147:8000/DSPartyManagement/api/partyManagement/v2/individual/jcarnero"
            }
        ],
        "realizingResource": [],
        "realizingService": [],
        "productPrice": [],
        "agreement": []
    }
]
fdelavega commented 6 years ago

Hi,

It is true that the productOffering field do not include the productSpecification reference. The point is that we are following the standard specification provided by the TMForum (it defines the structure for this JSON document). In general, reference fields such as productOffering or billingAccount, etc includes just the ID and the HREF (there are some exceptions such as related party which also includes the role). So the approach in these kind of scenarios typically is retrieving the object using the reference and then retrieve the info needed.

It is true, that in this particular case directly having the productSpecification reference might be useful and has sense, taking into account that this objects represents and acquired product.

Let me review the API specification and check what is the best approach to deal with this.

emepetres commented 6 years ago

I thought it was a bug, as productOffering field appears on the apiary docs under the Inventory Management API example

fdelavega commented 6 years ago

You are right, this is included in the documentation...