Layer7 API Management

Expand all | Collapse all

What is wrong in using of Validate OData Request Assertion

Jump to Best Answer
  • 1.  What is wrong in using of Validate OData Request Assertion

    Posted 10-11-2018 10:07 AM

    Hello Community,

     

    I am trying to use the "Validate OData Request" Assertion and set the following settings (s.attachment). 

    the context variable ${metadata} is set in the previous step (s. attachment). The URI is encoded correctly (/getStatus/Z_dataSet/(number=%2714460%27)), as it is mentioned in the docs error. I got the following error:

    "Could not parse OData resource path: Could not find an entity set or function import for 'getStatus'."

     

    I expect from the assertion, that this sets for me the variables like query.filter, query.top, as it is described in docs.

    Can you please help me, what is missing?

     

    Thank you,

    Oleks



  • 2.  Re: What is wrong in using of Validate OData Request Assertion

    Posted 10-14-2018 08:09 PM

    Hello Oleksii,

    It sounds like the request didn't match the SMD, could you show the content of ${metadata}?

     

    Regards,

    Mark



  • 3.  Re: What is wrong in using of Validate OData Request Assertion

    Posted 10-23-2018 09:52 AM

    Hello Mark,

     

    thank you for your response, it helped me to figure out the problem. After checking the metadata file it was clear, that my API should start with the same name as the entity set, i.e. Z_dataSet/(number=%2714460%27)). Now it runs at least without errors. But only a few of the context variables are set, the question is why such variables as top, filter, and co. are not set?  

     

    Example1:

    UEBERSICHTSet/$count?sap-client=100&$filter=((Erdat ge datetime'2018-07-20T12:34:36.154' and Erdat le datetime'2018-09-18T12:34:36.154')) and Kunnr eq '0000014460'.

     

    Result:

    odata.query.count= true
    odata.query.top=
    odata.query.filter=
    odata.query.skip=
    odata.query.orderby=
    odata.query.expand=
    odata.query.format=
    odata.query.inlinecount= none
    odata.query.select=
    odata.query.customoptions=
    odata.query.pathsegments= UEBERSICHTSet, $count

     

    Example 2:

    UEBERSICHTSet?$skip=0&$top=110&$filter=((Erdat ge datetime'2018-07-20T12:34:36.154' and Erdat le datetime'2018-09-18T12:34:36.154')) and Kunnr eq '0000014460'

    Result:

    odata.query.count= false
    odata.query.top=
    odata.query.filter=
    odata.query.skip=
    odata.query.orderby=
    odata.query.expand=
    odata.query.format=
    odata.query.inlinecount= none
    odata.query.select=
    odata.query.customoptions=
    odata.query.pathsegments= UEBERSICHTSet



  • 4.  Re: What is wrong in using of Validate OData Request Assertion
    Best Answer

    Posted 10-31-2018 08:52 AM

    I figured it out. The Resource which is going to be processed in the OData Assertion should be: ${request.http.uri}${request.url.query}. On such a way it contains the whole line (path and the query parameters) : UEBERSICHTSet/$count?sap-client=100&$filter=((Erdat ge datetime'2018-07-20T12:34:36.154' and Erdat le datetime'2018-09-18T12:34:36.154')) and Kunnr eq '0000014460'.