IBM Support

OA61974: NEW FUNCTION - JSON PARSER COMMENT TOLERATION SUPPORT.

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as new function.

Error description

  • JSON Parser comment toleration support
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED: Users of the z/OS JSON Parser portion        *
    *                 of the z/OS client web enablement toolkit    *
    ****************************************************************
    * PROBLEM DESCRIPTION: Although JSON format is                 *
    *                      human-readable text, when used for      *
    *                      configuration files the content can     *
    *                      become overwhelming.                    *
    ****************************************************************
    See problem description
    

Problem conclusion

Temporary fix

Comments

  • z/OS JSON Parser content in MVS Programming:
    Callable Services for High-Level Languages publication will be
    update to describe toleration support for commented JSON
    content. Those updates include the following content:
    
    SUPPORTED COMMENT STYLE
    
    The parser will successfully parse JSON text that contains
    single-line form (starts with a double-solidus and ends with a
    line terminator) or multi-line form (start with a
    solidus + asterisk, can span arbitrarily-many lines, and must
    end with an asterisk + solidus) comments.
    
    Example: single-line form commented JSON data
    
    //Testing ALL
    {
      //Testing CompletionCode
      "condition" : " String(CompletionCode) = '()' "
     ,"actions" :
      [
        {
          "action" : "sendMessage" //first action
         ,"message": " 'CompletionCode: '||String(CC)"
        }
      ]
    }
    
    BEHAVIOR DETAILS
    
    The default parser behavior will be to tolerate comments, with
    preferential treatment for uncommented JSON text. In other
    words, by default the parser will continue to deliver optimum
    performance for uncommented JSON text. The parsing
    performance for commented JSON text will always be slower in
    comparison, but can be optimized by including a comment as
    early in your data as possible, e.g.
    
    Commented JSON Example 1
    
    line 1 // JSON contains a policy definition <- 1st comment
    line 2 {
    line 3   "action" : "sendMessage" //first action
    line 4  ,"message": "'CompletionCode:'||String(CC)"
    line 5 }
    
    
    Commented JSON Example 2
    
    line 1 {
    line 2  "action" : "sendMessage" //first action <- 1st comment
    line 3 ,"message": " 'CompletionCode: '||String(CC)"
    line 4 }
    
    
    Commented JSON Example 3
    
    line 1 {
    line 2   "action" : "sendMessage"
    line 3  ,"message": " 'CompletionCode: '||String(CC)"
    line 4 } // The above was an action  <- 1st comment
    
    
    
    Of the three Commented JSON Examples above,
    Commented JSON Example 1 will have the best performance
    because the parser will detect it should tolerate comments
    when it reads the very first line. Commented JSON Example 3
    will have the worst performance of the three, because the
    parser will not be aware it needs to tolerate comments until
    the very end of the text and will need to re-parse the whole
    text body, resulting in two full parses.
    
    
    HWTJOPTS API
    
    The user can modify the parser behavior by taking advantage of
    the new HWTJOPTS API. This API allows the user to indicate if
    commented JSON should be rejected (HWTJ_TOLERATE_CMT_OFF) or
    if the parser should always assume the JSON text is commented
    (HWTJ_TOLERATE_CMT_ON). Usage of HWTJ_TOLERATE_CMT_ON will
    provide parsing performance for commented JSON, regardless
    of placement, on par with Commented JSON Example 1, however
    uncommented JSON text may experience a performance penalty.
    
    NOTE: This comment support is toleration only, the
    application will not be able to retrieve any of the comments
    detected in the JSON text, and the contents produced by
    HWTJSERI API invocation will exclude any comments that may
    have originally been present.
    

APAR Information

  • APAR number

    OA61974

  • Reported component name

    WEB ENABLMNT TL

  • Reported component ID

    5752SCHWT

  • Reported release

    500

  • Status

    CLOSED UR1

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    YesSpecatt / New Function / Xsystem

  • Submitted date

    2021-08-16

  • Closed date

    2022-06-13

  • Last modified date

    2022-09-08

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    UJ08662

Modules/Macros

  • HWTHMRXB HWTJCSS  HWTJCSS1 HWTJCSTB HWTJIASM HWTJIC   HWTJICOB
    HWTJIPLI HWTJKASM HWTJMAPI HWTJNONA HWTJSON  HWTTMREX
    

Publications Referenced
SA231377xx    

Fix information

  • Fixed component name

    WEB ENABLMNT TL

  • Fixed component ID

    5752SCHWT

Applicable component levels

  • R500 PSY UJ08662

       UP22/06/29 P F206  

Fix is available

  • Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.

[{"Business Unit":{"code":"BU011","label":"Systems - zSystems software"},"Product":{"code":"SG19O"},"Platform":[{"code":"PF054","label":"z Systems"}],"Version":"500"}]

Document Information

Modified date:
08 September 2022