Open APIs

 View Only
  • 1.  TMF641 Characteristic Value

    TM Forum Member
    Posted Sep 05, 2019 08:14

    (apologies if this is a dupe, I thought I had submitted it but can't find it, so perhaps not)

    We're currently looking at using TMF641. We're using standard tools (swagger-code-gen @ https://github.com/swagger-api/swagger-codegen) to convert the Swagger spec. for 641 to some POJO Java model objects. FWIW, we're using V.18.5, also referenced as version 4.0.0 in the swagger file itself, not sure which version is the 'correct' reference.

    Now, the trouble is that the value of the "Characteristic" is of type "Any". I see from Open APIs that it can be "any json object". The trouble is, the swagger spec has no value for an "Any". Now, the thread mentions that a provider should set a @type / @schemaLocation for this object, ​​but that doesn't help with the code generated from the swagger spec. Is the intent that a provider would take the swagger spec and customise it for their use case? Or is there a way to set/get a value from an "Any" using the generated code that I'm missing?

    Thanks in advance for any advice you can offer!



    ------------------------------
    Greg Thomas
    ------------------------------


  • 2.  RE: TMF641 Characteristic Value

    TM Forum Member
    Posted Sep 05, 2019 08:59

    (I originally posted that earlier this week, took a while for the moderation to come through).

    It turns out that simply upgrading the tool I was using to generate my Java code (from io.swagger.codegen.v3:swagger-codegen-cli:3.0.11 to'org.openapitools:openapi-generator-cli:4.1.1) solved my problem.

    With the former, the Characteristic value field was of type Value - with nothing to set, and I couldn't work out how to sanely extend it using Swagger/OpenAPI
    With the latter, the Characteristic value field was of type Object - which makes things a lot simpler!

    Thanks for listening



    ------------------------------
    Greg Thomas
    ------------------------------