API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#API Connect
#Applicationintegration
#APIConnect
 View Only
  • 1.  Creating JSON Schemas with Arrays

    Posted Mon March 04, 2024 05:55 PM

    HI,

    I have a requirement to create a JSON schema from the following sample payload. I have figured out creating the basic properties. I need help in creating the array of objects within the structure using the form option in the design panel.

    {
    "PurchaseOrderNumber": "889980039555432200",
    "orderStatus": "Shipped",
    "orderDate": "20231003",
    "orderTimeStamp": "172709",
    "carrier": "WILL",
    "actualPickupPersonName": "JOBY JOSEPH",
    "timeZone": "EST",
    "lineitemsCollection": [
    {
    "lineitemsItem": {
    "articleNumber": "000000000000010045",
    "itemQuantity": 4.000,
    "unit": "EA",
    "dotCollection": [
    {
    "dotItem": {
    "dot": "DOT5678902517"
    }
    },
    {
    "dotItem": {
    "dot": "DOT5678902517"
    }
    },
    {
    "dotItem": {
    "dot": "DOT5678902518"
    }
    },
    {
    "dotItem": {
    "dot": "DOT5678902519"
    }
    }
    ]
    }
    Thanks,
    Paul



    ------------------------------
    Paul Dango
    ------------------------------


  • 2.  RE: Creating JSON Schemas with Arrays

    Posted Tue March 05, 2024 01:44 PM
    Edited by Paul Dango Tue March 05, 2024 01:44 PM

    The answer is to select the option to infer the schema from a sample json payload. 

    The source view provides the full schema created. Although the form view does not display the full schema.



    ------------------------------
    Paul Dango
    ------------------------------



  • 3.  RE: Creating JSON Schemas with Arrays

    Posted Wed March 06, 2024 09:19 AM

    Hi Paul,
    You beat me to the answer :-) I'll just add that the UI for definitions will only show the root primitive properties, but it will not step into object and arrays to show their children as you noted.

    Regards,
    Steve



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------



  • 4.  RE: Creating JSON Schemas with Arrays

    Posted Wed March 06, 2024 11:17 AM
    HI Steve,

    Thank you for the confirmation and additional clarification.

    Paul