Open APIs

Expand all | Collapse all

Depth and Expand Directive

  • 1.  Depth and Expand Directive

    TM Forum Member
    Posted Apr 30, 2019 06:22

    Hi everyone.
    REST API Guidelines 3.0 part 2 has a section detailing how to use depth and expand directives.
    However, I have some doubts regarding the actual implementation  of these directives.

    We can expand up to the level of depth using the depth parameter and narrow down the expansion of referenced object using the expand parameter.  Taking in consideration the guideline examples, we can have something like:

    GET /catalogManagement/productOffering/23/?depth=3&expand =productOffering.productSpecification

    Now imagine, that I'm not using the expand parameter to narrow down the referenced objects:
    GET /catalogManagement/productOffering/23/?depth=2
    This means that I will expand references such as PlaceRef or ServiceCandidateRef.

    To have the actual implementation of these expansions, should I change the current swagger file of TMF620 to have the entire definition of possible resource to be expanded?

    Thank you for your help!



    ------------------------------
    Lara Silva
    Vodafone Group
    ------------------------------


  • 2.  RE: Depth and Expand Directive

    TM Forum Member
    Posted 28 days ago
    Hi,

    If you use the swagger files that is indeed what you need to do.
    Everywhere where a reference is used you must allow a full object to be transferred.
    The swagger files currently provided don't seem like a complete implementation yet.

    It also depens largely on the API model you want to use:

    1/ Design First
    Generate boiler plate code from a swagger provided by TMF to get started.

    2/ Code First
    Generate your own swagger documentation from code.

    I personnally favour the second method.


    ------------------------------
    Koen Peeters
    Ciminko Luxembourg
    ------------------------------