Open APIs

 View Only
  • 1.  TMF645 and the non usage of AllOf

    TM Forum Member
    Posted Jan 21, 2020 11:20
    Hi guys, just want to understand those defs


    "ServiceQualification": {
    "type": "object",
    "description": "ServiceQualification is used to perform a technical eligibility. It allows to retrieve a list of services that are technically available in the context of the interaction (place, party, service characteristics, ...).",
    "required": [
    "serviceQualificationItem"
    ],

    "ServiceQualification_Create": {
    "type": "object",
    "description": "ServiceQualification is used to perform a technical eligibility. It allows to retrieve a list of services that are technically available in the context of the interaction (place, party, service characteristics, ...).\nSkipped properties: id,href",
    "required": [
    "serviceQualificationItem"
    ],

    "ServiceQualification_Update": {
    "type": "object",
    "description": "ServiceQualification is used to perform a technical eligibility. It allows to retrieve a list of services that are technically available in the context of the interaction (place, party, service characteristics, ...).\nSkipped properties: id,href,effectiveQualificationDate,serviceQualificationDate,serviceQualificationItem",
    "required": [
    "serviceQualificationItem"
    ],


    My question is why there no inheritance at all between those definitions with the use of allOf for example ?  This is prohibited when writing a open api spec ?

    Thanks for the clarification :)







    ------------------------------
    Christian Lévesque
    TELUS
    ------------------------------


  • 2.  RE: TMF645 and the non usage of AllOf

    TM Forum Member
    Posted Jan 22, 2020 07:10
    Hi Christian

    The Open API swagger files are generated by tooling from a single source of truth, JSON schema, together with metadata. So we have (for example) a ServiceQualification.schema.json file that contains the full definition of the resource, and then we have metadata saying which fields are not relevant on creation (e.g. id and href), and which are not patchable (e.g. creationDate). The _create and _update defs in the swagger are then created as restrictions of the full resource schema, according to the metadata. allof is not really helpful here.

    It would be a good CR request to SmartBear to get them to add a restriction semantic to Swagger syntax, but I doubt that anything like that would happen in the near future, or at all.

    Adding @Henrique Rodrigues - our toolmeister - for his perspective. And @Ludovic Robert, the current lead for this API.

    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: TMF645 and the non usage of AllOf

    TM Forum Member
    Posted Jan 22, 2020 08:30
    Edited by Christian Lévesque Jan 22, 2020 08:36
    Thanks for the response, it's appreciated.

    I'm designing a KONG api in my company and I was looking for some example on how I could manage my definitions. So I check on how those open apis were designed and felt on this.
    So your architecture before your generation tool shares the same definition and then it split it apart. So if I understand correctly, we kind of lost the power of inheritance somewhere.
    Maybe I'm coming from old school but I hate when I see multiple copies of the same thing here and there :)

    So, for someone that design REST api using the fmforum 630, it's not clear whether or not we should separate definitions into _Create, _Update, etc or trying to use mostly the allOf to avoid duplication and follow inheritance pattern. I'd like your thoughts about this.

    Thanks again :)

    ------------------------------
    Christian Lévesque
    TELUS
    ------------------------------