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
Workspace z/OS Connect
Created by Guest
Created on Sep 10, 2018

z/OS Connect EE 3.x Nullable field support

DB2 RESTful API definition via API TOOLKIT require SAR file generated by BUILDTOOLKIT.
BUILDTOOLKIT requires REQUEST/RESPONSE schema created under DB2 RESTful SERVICE capabilities.
They carry NULLABLE parameters/fields. While defining PATH parameters during API definition, users' are unable to MAP them as NULLABLE fields are not supported under Swagger 2.0 SPECIFICIATION.

Till z/OS Connect EE can support Swagger 3.0, We need a way where USERS' can map NULLABLE fields via API toolkit..

Idea priority High
  • Admin
    Demelza Farrer
    Reply
    |
    Jan 16, 2024

    This requirement is addressed by z/OS Connect V3.0.55 / APAR PH43628:

    https://www.ibm.com/support/pages/apar/PH43628

    For further details see the z/OS Connect (OpenAPI 3) Documentation:

    https://www.ibm.com/docs/en/zos-connect/zos-connect/3.0?topic=dpoop-map-api-response-fields



  • Guest
    Reply
    |
    Jun 1, 2020

    I also require similar capability, by use case is for consuming DB2 REST Services via ZOS Connect

    I have the following DB2 Native REST API Defined, with 2 predicates (BLOCK_ID and JOBNAME).
    SELECT
    JOBNAME, ERROR_ID, BLOCK_ID,
    CAST(CAST(ID_SA AS BIGINT) AS VARCHAR(20)) AS ID_SA,
    PROCESS, CHANGE_TRANSID, CHANGE_TIMESTAMP, CHANGE_USERID,
    ERROR_DESC
    FROM MyTable
    WHERE BLOCK_ID=:blockId
    AND (JOBNAME=:jobName OR
    NULLIF(CAST(:process AS CHAR(08)),'') IS NULL)
    /*
    The JOBNAME predicate has been set up so if you send the value it is used in the JOBNAME=:jobname and if you don't send a value the NULLIF(CAST(:process AS CHAR(08)),'') IS NULL) is used which resolves to NULL IS NULL and hence this part becomes true. The result is the query should work if you send a value or if NULLS are provided effectively providing optional predicates.

    I have created a Z/OS Connect Service for this API and am using this service in a Z/OS Connect GET Operation. What I want to be able to do is use JobName as an OPTIONAL queryparm. If I provide jobName it is passed to the DB2 API.

    What I am finding is that if jobname queryparm is NOT provided, the DB2 API fails as the JSON payload sent to the DB2 API does not contain the jobname queryparm and hence cannot be mapped into the :jobname host variable of the DB2 API.

    For example, this APi requests works OK as it provides both queryparms
    [http://%3chost%3e:%3cport%3e/djc-ibm-ticket-api/ticket?blockId=13&jobName=DJC10]http://:/djc-ibm-ticket-api/ticket?blockId=13&jobName=DJC10
    and returns the correct rows from the database

    But if I don't provide one of the parms, for example jobname
    [http://%3chost%3e:%3cport%3e/djc-ibm-ticket-api/ticket?blockId=13&jobName=DJC10]http://:/djc-ibm-ticket-api/ticket?blockId=13
    the DB2 API fails and I see two messages in the Z/OS Connect log file. I think the first message is because the jobname queryparm was not specified on the API, then the JSON request sent to DB2 API did not contain the jobname tag, then when the DB2 API tries to set up the JOBNAME predicate it fails as the host variable is not available.
    ]
    [5/18/20 14:17:48:708 BST] 00006663 osconnect.service.client.rest.internal.RestClientServiceImpl E BAQR0558E: The remote service invocation failed with response message: HTTP 400 Bad Request and response body: {"StatusCode":400,"StatusDescription":"Execution failed for DB2 REST Service Manager csdb2rest_mig_err_get_x during the invoke service process due to unmatching jobName key in JSON input parms. Error Location:DSNLJSSP:20"}.
    [5/18/20 14:17:48:709 BST] 00006663 com.ibm.zosconnect.internal.web.ServiceProxyServlet W BAQR0429W: API djc-ibm-ticket-api encountered an error while processing a request under URL http://ibmmce01.uk.ssegroup.net:9082/djc-ibm-ticket-api/ticket.


    Is there a way of getting Z/OS Connect and DB2 Native APIs to work in this manner so that I can use optional queryparms?

    I think at the moment, what I need is in the Z/OS Connect API, when mapping the request to be able to have conditional logic – but this capability is not available, I can either map a queryparm or have a default value, but I cannot mix the two.
    If jobname queryparm is provided
    Map jobname to JOBNAME
    Else
    Map “NoValue” to JOBNAME
    End

    This would allow me to default the value being sent to the DB2 API to a specific value IF the queryparm is not provided on the request.

    Then use a DB2 Statement like
    SELECT
    JOBNAME, ERROR_ID, BLOCK_ID,
    CAST(CAST(ID_SA AS BIGINT) AS VARCHAR(20)) AS ID_SA,
    PROCESS, CHANGE_TRANSID, CHANGE_TIMESTAMP, CHANGE_USERID,
    ERROR_DESC
    FROM MyTable
    WHERE BLOCK_ID=:blockId
    AND (JOBNAME=:jobName OR
    OR :jobname = 'NoValue')

0 MERGED

Properly generate the Swagger file generated for z/OS Connect Db2 Service I don't have to change it.

Merged
The swagger file that is produced after you create a DB2 Service and do a GET on the swagger. The process injects the below line into the swagger: "\"null\"", This line has to be deleted before you can run the build toolkit to create the .sar file...
almost 6 years ago in z/OS Connect 2 Delivered