TM Forum Community

 View Only
Expand all | Collapse all

SchemaLocation Query

  • 1.  SchemaLocation Query

    Posted Oct 04, 2022 13:57
    Hi All,


    1- Can you please provide URL where we can download schema of TMF641 V4.1.0?


    "serviceCharacteristic": [
              {
                "name""cloudone-service-create",
                "valueType""object",
                "value": {
                  "@type""JSONSpecification",
                  "@schemaLocation""XXXXXXX"
                  
                }
              }
            ]


    2- What should mention in schema location in service characteristic should it be TMF 641 V4.1.0 schema location or custom to the service?
    3- Does that schema location refer to the client's schema location or TMF implementation schema location?
    #General

    ------------------------------
    Shivam Chauhan
    Zensar
    ------------------------------


  • 2.  RE: SchemaLocation Query

    TM Forum Member
    Posted Oct 05, 2022 09:59
    Good day,

    The schema for that API can be found at https://github.com/tmforum-apis/Open_Api_And_Data_Model/tree/master/apis/TMF641_Service_Ordering.  This is part of the TMForum GitHub project that maintains all of the published APIs and schemas.

    As for the content of @schemaLocation, that can reference a local repository of the schema.  That way, if the app validates the message against the schema, it only needs to reference something within your network and not on the internet.

    Sean

    ​​

    ------------------------------
    Sean Garagan
    Bell Canada
    ------------------------------



  • 3.  RE: SchemaLocation Query

    Posted Oct 05, 2022 13:08
    Hi Sean,

    Thanks for sharing the location for swagger, is there a JSON schema already available based on resource model of TMF 641 specification.

    ------------------------------
    Shivam Chauhan
    Zensar
    ------------------------------



  • 4.  RE: SchemaLocation Query

    TM Forum Member
    Posted Oct 05, 2022 14:58
    Hey Shivam,

    The whole set of published APIs and schemas for v4 can be found at https://github.com/tmforum-apis/Open_Api_And_Data_Model.  So under the schemas folder in that project are the JSON schemas but the 641 Swagger files are generated from these.  This means that the API Swagger files have the JSON entities defined within them and as such are self-contained.

    Thanks,
    Sean

    ------------------------------
    Sean Garagan
    Bell Canada
    ------------------------------



  • 5.  RE: SchemaLocation Query

    TM Forum Member
    Posted Oct 06, 2022 02:37
    Hi Sean. Shivam, and all
    Please be aware that the referred GitHub repository is not necessarily being maintained up-to-date. You will note that it was lasted refreshed 9 months ago.
    If you need up-to-date schemas, you'll need to take them from the published Swagger/OAS files at the Open API table https://projects.tmforum.org/wiki/display/API/Open+API+Table
    And be aware that these files contain the schemas after pre-processing. flattening, resolving allof, etc.

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



  • 6.  RE: SchemaLocation Query

    TM Forum Member
    Posted Oct 07, 2022 08:10
    Hey Jonathan,

    I thought that the GitHub project had the published schemas, hence the lack of recent updates but it sounds like it is not kept in sync with any changes that happen on the link you posted.  I definitely use that link, along with the early access one, but the GitHub project is much easier for people to clone locally to keep a reference copy or for extending as needed.

    Thanks for the heads up,
    Sean

    ------------------------------
    Sean Garagan
    Bell Canada
    ------------------------------



  • 7.  RE: SchemaLocation Query

    Posted Oct 07, 2022 08:11
    Hi Jonathan,
    We have a requirement that whenever we receive service order from external system,we have to validate the service order request to check if the request payload aligns to TMF 641 specification,if it does not then we reject the request.
    Hence we were looking at schema for TMF 641 against which we can validate using any json schema validators rather than hand writing the rules to validate against incoming payload against the schema.
    As per your message above,only updated reference for us is to go with swagger specifications which has the JSON schemas built in to it.So what is the suggested approach /best practise to do the request schema validation across various implementations you have seen so far?

    Any inputs from your side would be very helpful

    Regards,
    Rashmi

    ------------------------------
    Reshmi G C
    Cisco Systems
    ------------------------------



  • 8.  RE: SchemaLocation Query

    TM Forum Member
    Posted Oct 20, 2022 04:45
    Hi Rashmi
    Unfortunately I don't know how to answer this question. I can only suggest that you search the internet for open-source or commercial validation frameworks.
    Be aware that schema checking will add latency to your API response times.

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



  • 9.  RE: SchemaLocation Query

    Posted Oct 22, 2022 09:32
    Hello All,
    Speaking from past experience with XML schema based APIs.

    One matter to consider is what using schema-based validation actually gives you. 
    When working with a new or changed application which is providing an API, doing some conformance testing is useful. Validation against the OAS spec is useful in that case.

    Similarly, when someone is working on a consuming application then checking against an OAS spec can help during development.
    Reva: Validate requests with OpenAPI in Node.js 

    But once integrated I am not certain that such a validation is likely to find much variation in API usage?

    As Jonanthan said there are various projects for languages that provide validation packages like this one for Node.
    APIs With Node.js and Express: Automatically Validate API Requests Using an OpenAPI 3 Specification - DZone Integration 

    I have not used either of these, but I think the critical thing is that if you intend to validate this way in production you need two things.
    First off will it be performant for a synchronous API?

    Secondly, who is the recipient of any error messages? Are failed requests going to an error hospital for enterprise app support to deal with an issue or is this going back to the user of the client app. If it is the latter, you need a toolkit where errors can be caught and returned as more accessible error responses to go in entity representations associated with the appropriate http status code.




    ------------------------------
    Derrick Evans
    ------------------------------



  • 10.  RE: SchemaLocation Query

    Posted Nov 21, 2022 05:06
    is there a JSON schema already available based on resource model of TMF 641 specification.

    ------------------------------
    amris hhpuri
    TO BE VERIFIED
    ------------------------------



  • 11.  RE: SchemaLocation Query

    TM Forum Member
    Posted Nov 21, 2022 05:12
    I repeat my message above, which is that Open API schemas are not currently being published. The published swagger file for each API, such as TMF641 Service Order, includes full JSON schema definitions with no external references. However the schema definitions in the swagger are processed, e.g. all the  "$ref": statements are resolved to include the contents within the swagger #definition section.​

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