Open APIs

 View Only
  • 1.  Can href have relative path?

    TM Forum Member
    Posted Mar 04, 2020 11:04
    Hi,

    Here is an example of what href field looks like in TMF objects.

    "href": "http://host:port:location/activation/monitor/14

    Is it acceptable to only return the relative path in href (like /activation/monitor/14)?

    Here is the background.

    In our software that integrates multiple TMF-compliant spoke systems, an incoming GET request flows to a Routing service that forwards it to an appropriate spoke system. Likewise, an event published by a spoke system is routed through a central layer to listening systems.

    As the end system that returns data does not quite know the original URL used by the client to invoke the GET (due to redirection as above), it is not straightforward to return the href based on the original URL.



    ------------------------------
    Madhu Narasimhan
    Oracle Corporation
    ------------------------------


  • 2.  RE: Can href have relative path?

    TM Forum Member
    Posted Mar 05, 2020 04:44
    My understanding is that the href needs to be an absolute uri that allows (in principle) retrieval of the entity to which the href points to.
    Intermediate layers (e.g. API gateway) that "massage" the messages would be expected to do uri substitution to ensure that uri fields in the output can be resolved.
    Hope it helps.

    ------------------------------
    Jonathan Goldberg
    Amdocs Management Limited
    Any opinions and statements made by me on this forum are purely personal, and do not necessarily reflect the position of the TM Forum or my employer.
    ------------------------------



  • 3.  RE: Can href have relative path?

    TM Forum Member
    Posted Mar 05, 2020 15:09
    Thanks, Jonathan for the clarification.

    ------------------------------
    Madhu Narasimhan
    Oracle Corporation
    ------------------------------



  • 4.  RE: Can href have relative path?

    TM Forum Member
    Posted Apr 11, 2022 04:04
    TMF630 Part 1 defines that the API Version is part of the URI.
    If href must be the absolute URI of the referred resource, it then also contains the API Version.
    So if e.g. in ProductInventory-API we have a RelatedParty as reference to an individual in the Party-API, its href points to e.g.

    {serverRoot}/partyManagement/v1/individual/42

    when the URI of the API is built accouding to TMF630 Part 1: {serverRoot}/{apiName}/{apiVersion}.

    When version v1 of the Party API is taken out of operation because we now have a version 2 running, that href points to nowhere, the version number must be updated.

    And further, if there are two versions v2 and v3 running - which may be necessary to give consumers time to adapt to the breaking change that made the new versions necessary - the provider, in this case the ProductInventory API, would not know which version to return, as it does not know which version the consumer is using.

    The best solution would therefore be to define href as relative to the API's URL, i.e. the actual URI of the resource would then be

    {serverRoot}/{apiName}/{apiVersion}/{href}

    That also makes it possible to move the API to some other server, or even to rename the API, without impacting the href.

    ------------------------------
    Lutz Bettge
    Deutsche Telekom AG
    ------------------------------