Open APIs

 View Only
  • 1.  Usage of upper and loew case in TMF 620, 621, 622, 637

    TM Forum Member
    Posted Sep 15, 2022 08:39
    Hi all,
    I would like to ask if the usage of upper case in the fields "status" and "lifecycleStatus" (in TMF 620 Catalog, TMF621 Trouble Ticket, TMF637 Inventory, TMF 622 Order) is compliant or not with the TMF specifications?

    I am asking because in the sample i noticed some lower case, but in the state model in the documentations there is a mix of upper and lower case (e.g. InProgress).
    Thanks in advance,

    ------------------------------
    Filippo Roberto Valeriani
    NTT DATA CORPORATION
    ------------------------------


  • 2.  RE: Usage of upper and loew case in TMF 620, 621, 622, 637

    TM Forum Member
    Posted Sep 19, 2022 16:30
    Your examples (status" and "lifecycleStatus") are not upper case but camel case.
    I read somewhere (probably TMF 630, but I could be wrong) that you can use both:
    • camel case (status" and "lifecycleStatus"...)
    • lower case
    your example of "InProgress" is probably a value, not an attribute or an entity name. For attribute values, it is always up to you!

    All my developers are not fond of camel case, at all! They would prefer to use lower case only.
    But we use it because that's how we see attribute names in all the files provided by TMF API project.

    ------------------------------
    Kind regards,

    Matthieu Hattab
    Lyse Platform
    ------------------------------



  • 3.  RE: Usage of upper and loew case in TMF 620, 621, 622, 637

    TM Forum Member
    Posted Sep 20, 2022 03:23
    Hi Matthieu,
    thanks for your feedback. I found in the TMF 630 the following sentence:

    "Names in URI (tasks, individual resources, etc.) MUST be camel case or lower case."

    So if i correct got the point means that an attribute (e.g. "status") must be in lower case or camel case, while the attribute values (e.g. COMPLETED, FAILED, INPROGRESS) is up to me, so it can be valorized also in upper case, is my assumption right ?

    Thanks again for you response,

    ------------------------------
    Filippo Roberto Valeriani
    NTT DATA CORPORATION
    ------------------------------



  • 4.  RE: Usage of upper and loew case in TMF 620, 621, 622, 637

    TM Forum Member
    Posted Oct 02, 2022 05:07
    Hi
    I've taken a quick look at some of the existing enum types in the Open API data model. My observation is that the values of the enum are camel case, i.e. first word starts with lower case and subsequent words (if any) start with upper case.
    For example ServiceStateType, has designed, feasibilityChecked, etc.
    So it appears that there is an unwritten convention that values do indeed follow camel case.
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "$id": "ServiceStateType.schema.json",
      "title": "ServiceStateType",
      "definitions": {
        "ServiceStateType": {
          "$id": "#ServiceStateType",
          "type": "string",
          "description": "Valid values for the lifecycle state of the service",
          "enum": [
            "feasibilityChecked",
            "designed",
            "reserved",
            "inactive",
            "active",
            "terminated"
          ]
        }
      }
    }
    ​


    ------------------------------
    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.
    ------------------------------