Skip to Main Content
IBM Z Software


This portal is to open public enhancement requests against IBM Z Software products. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Delivered
Categories z/TPF
Created by Guest
Created on Jun 25, 2018

zREST zDFDL to suport zDFDL expression for the Code Page Encoding Attribute (and DFDL variable for operationId)

z/TPF's zDFDL transformation needs a parameter to specify Code Page of the target transformed object so that EBCDIC 1047, subset of P1024 Terminal Characters in EBCDIC 1047, and UTF-8. This would avoid loading multiple zSwagger Files and zREST System Definition Files to support multiple implementations of the same zREST Operations that only differ in the target code page and supporting target application.

Background from z/TPF's Brad Kadlecik:
I also reviewed the DFDL spec for the dfdl:encoding attribute and it mentions that this can be a DFDL expression. zDFDL currently does not allow a DFDL expression for this attribute in our implementation however it would not be difficult to add it. So an alternative idea (instead of creating 2 DFDL files that just differ for encodings) is that a single DFDL file could be used and we (IBM - REST provider/consumer) can create a DFDL variable that contains the operationId such that one can decide which encoding to use based on an operationId. Another IBM provided DFDL variable could be the status code such that different message formats can be described in a DFDL file for different response data based on status code.

So instead of having dfdl:encoding="x-ibm-1047-s390" (the default) or dfdl:encoding="utf-8" in a separate file; this can be expressed in a single statement like:
dfdl:encoding="{if ($tddt:operationId eq 'newService') then 'utf-8' else 'x-ibm-1047-s390'}"

This is a runtime operation that would have to be performed on each string that may differ in such a way but up to you of course on how you'd want to manage these differences between the services.
The encoding for the HTTP body can be specified in a HTTP header like "Content-Type: application/json; charset=utf-8" but this is not universally recognized since the charset attribute is normally used for a text MIME type such as "text/plain; charset=ascii" rather than application MIME type in which the charset is understood. For example, MIME type of "application/xml" depends on it being specified on the first line of the XML document; whereas, MIME type of "text/xml" can use charset to specify it instead. There is no MIME type of "text/json". The REST provider support does look at this header to determine whether it is an XML or JSON body but charset is never checked for. The only allowable encodings for a MIME type of "application/json" are UTF-8, UTF-16, or UTF-32. In reference to this MIME type, the charset attribute is not used but rather the first character of the JSON is examined to determine between the 3 unicodes with UTF-8 being the default. The DFDL and JSON parsers on z/TPF would need the JSON document to be in UTF-8 to handle it properly though.

Idea priority High
  • Guest
    Reply
    |
    Jun 28, 2019

    This is available with z/TPF APAR PJ45579.