IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
 View Only
Expand all | Collapse all

Curious about design decisions concerning JSON outputs

  • 1.  Curious about design decisions concerning JSON outputs

    Posted Wed April 12, 2023 12:02 PM

    Hi there!

    Let me be an old man complaining about stuff for a bit, if you don't mind:

    - "attribute": "value" is valid JSON, but so is
    - "attribute": "" and
    - "attribute": null and, finally:
    - (no "attribute" present)

    Moreover, these are, as far as I know, all distinct values: null != "" != "value" != (omitted value).

    Now I can understand it's a bit hard to code for "attribute": null when there's only the NONE keyword to work with, and not a NULL keyword that's distinct from NONE. So I'm not complaining about not being able to create the output "attribute": null.

    But why on Earth does ITX equate "" === (omitted value)? Why isn't it possible to say "attribute": "" without generating a custom TT, even though the notation is not just perfectly valid JSON, but a frequent occurrence?

    Am I missing something in the Map Settings or output card settings that should make such a fairly reasonable thing possible? Or am I just completely misreading the JSON RFC?

    Thanks for reading my ramble!

    Regards,

    Nout



    ------------------------------
    Nout Hoozemans
    ------------------------------


  • 2.  RE: Curious about design decisions concerning JSON outputs

    Posted Wed April 12, 2023 04:07 PM

    It is, apparently, possible to generate "attribute": "" or even "attribute": null by copying "attribute" directly from an input card that contains the values "" or null.

    It's not the neatest solution, but it works, and I don't have to generate a TT.



    ------------------------------
    Nout Hoozemans
    ------------------------------