Layer7 API Management

  • 1.  JSONPATH doesn't work on spaces " "

    Posted Apr 10, 2019 03:45 PM

    Hi All,

     

    I am trying to extract the value using JSON path

     

    {

    "test":"something",

    "Name ": "Bob"

     

    }

     

    The JSON path using Name doesn't work



  • 2.  Re: JSONPATH doesn't work on spaces " "

    Broadcom Employee
    Posted Apr 10, 2019 04:00 PM

    Hi Pramod, 

     

    Try .['Name ']

     

     

    Regards,

    Joe



  • 3.  Re: JSONPATH doesn't work on spaces " "

    Posted Apr 10, 2019 04:12 PM

    Thanks for providing the solutions. The solution won't work if another extra space is added as the JSONPath only covers one additional space. Problem I don't know the how much spaces it will have the left or right ""



  • 4.  Re: JSONPATH doesn't work on spaces " "

    Posted Apr 10, 2019 04:37 PM

    Also forgot add this. Since  spaces in between "" is valid JSON messages it's hard to say to consumer stating JSON message is invalid.