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.  Set Json limit on a particular Api using GatewayScript

    Posted 12/24/21 12:55 AM
    Hello team ,

    Can we set json max length for a particular Api using gatewayscript.?

    ------------------------------
    Pawan Jinaga
    ------------------------------


  • 2.  RE: Set Json limit on a particular Api using GatewayScript

    Posted 12/27/21 02:02 AM

    No need to use gateway script. Use a parse settings object.

     






  • 3.  RE: Set Json limit on a particular Api using GatewayScript

    Posted 12/27/21 04:15 AM
    JSON limit on particular API could be set in Parse policy "Parse settings literal configuration" or other "Parse settings ..."​​ parameters. Or is it necessary to set it from GS?
    Some examples here

    ------------------------------
    Denis Migulin
    ------------------------------



  • 4.  RE: Set Json limit on a particular Api using GatewayScript

    Posted 01/04/22 09:22 AM

    Hi Pawan,

    The JavaScript engine implements JSON.parse in GatewayScript so any DataPower object will not impose parse limits.  As noted you'll need to use a parse policy in v10.  If you're using v5, the only option I can think of is a custom policy that takes the payload and passes it to a HTTP Convert DataPower action with JSON encoding.  This will use the JSON parse settings specified on the service's XML Manager's JSON setting object, in the case of v5 the webapi XML Manager.  Depending upon your v5 version, you may need to update both the XML manager to specify your own JSON settings object as older versions of v5 used the default JSON settings and did not reference an object.  Newer versions of the product would have a JSON settings object already referenced so you'd just need to update those settings.  Since these are product objects, you would need to override these object's configurations by specifying an updated configuration in a gateway extension.

    Regards,

    Steve



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