Layer7 API Management

 View Only
  • 1.  JSON Schema Validator - Behaving Incorrectly

    Posted Jul 28, 2020 08:13 PM
    Edited by Prasantha Sivabalasunderam Aug 17, 2020 03:15 AM
    Hi, 
    I have below JSON Schema to Validate the request. AccountId type has to be number and maximum character length should be 20.
    API Gateway terminates abruptly as it tries to validate when I enter AccountId with 20  more characters length and returns http status 200 as if succeeded the validation.
    It seems to be an issue with API Gateway. Appreciate if anyone came across the same issue and any recommendation to resolve this.
    "AccountId": {
          "required": true,
          "type": "number",
          "minimum": 1,
          "maximum": 99999999999999999999
    }
    API Gateway version: 9.2
    Component


  • 2.  RE: JSON Schema Validator - Behaving Incorrectly

    Broadcom Employee
    Posted Jul 29, 2020 11:14 AM
    This worked fine for me, what version of the gateway are you using and what version of JSON schema are you validating with?

    If I pass in a number greater than the specified maximum It fails the assertion and I can see message indicating failure. 

    20200729 11:06:31.829 INFO 9130 JSON Schema validation failure. $.AccountId: must have a maximum value of 1.0E20: Attempted to validate with JSON Schema Draft V4




  • 3.  RE: JSON Schema Validator - Behaving Incorrectly

    Posted Aug 17, 2020 03:15 AM
    Hi Barry, I am still having this issue with API Gateway 9.2


  • 4.  RE: JSON Schema Validator - Behaving Incorrectly

    Broadcom Employee
    Posted Aug 18, 2020 09:29 AM
    Edited by Barry Stern Aug 18, 2020 09:29 AM
    Hello 

    You say "API Gateway terminates abruptly as it tries to validate when I enter AccountId with 20 ...." do you see any messages in the ssg logs? 

    Maybe if you provided a bit more detail including the JSON schema you are using and the payload you are testing with we might be able to help you out 

    I tested with a very simple schema and its working as expected a failing if I pass a Accountid greater then 20 characters long.