Customizing generated JSON schemas

The JSON schemas that are generated by DFHLS2JS contain some automatically generated content that might be appropriate for you to change before publishing. Customizing JSON schemas can result in regenerating the web services binding file and, in some cases, writing a wrapper program.

About this task

Follow these steps to customize generated JSON schemas:

Procedure

  1. To advertise support for HTTPS, use the URI parameter in DFHLS2JS to set an absolute URI.
  2. To supply the network location of your web service, use the URI parameter in DFHLS2JS to set an absolute URI.
  3. Consider whether the automatically generated names in the JSON schema are appropriate for your purposes. You can rename the properties.

    These values form part of the programmatic interface to which you code a client program. If the generated names are not sufficiently meaningful, maintenance of your application code might be more difficult over a long period of time.

    If you change any of these values, you must use DFHJS2LS to regenerate the web services binding file. The language structures that are produced are unlikely to be compatible with your existing application, so application changes might be required. Review the generated language structures, and consider writing a wrapper program as discussed below.

  4. Consider if the COMMAREA fields exposed in the JSON schemas are appropriate. You might consider removing any fields that are not helpful to a JSON client developer:
    • Fields that are used only for output values can be removed from the schema that maps the input data structures.
    • Filler fields.
    • Automatically generated annotations.
    If you make any of these changes, you must regenerate the web services binding file using DFHJS2LS. The new language structures that are generated are not compatible with the original language structures, so you must write a wrapper program to map data from the new representation to the old one. This wrapper program needs to perform an EXEC CICS LINK command to the target application program and then map the returned data.

    This level of customization requires the most effort, but results in the most meaningful programmatic interfaces for your JSON client developers.

Results

You have a customized JSON schema that matches your business requirements, and a PROGRAM in CICS that implements them.


dfhws_customizing_jsonschemas.html | Timestamp icon Last updated: Thursday, 27 June 2019