Recent Posts

    Authors

    Published

    Tag Cloud

    301 302 404 accessibility accounts ACLs advertising aggregation Agile Analytics android APP Article attachments awards backup BCM beta browser business continuity Calendar case-study categories Chrome citigroup cms codes coding standards Complaints contact management software control panel crm CSS customer management software customer relationship system customize database DataModel DDoS demo design designer device compatibility difference distribute a published article via email DND DNS documents drag & drop Editor email EOL erp event Excel featured feeds file manager file sharing file volume Firefox Firewall HA hack Handlebar how-to HTML HTML5 HTTP HTTPS iCal IE Instructions intranet iOS iPad Java JavaScript JDBC JDK Jenkins Job Track Journal JSON JVM landing-page launcher layered database layout logging login mac marketing menu meta Microsoft Outlook mobile module modules mustache navigation NTLM offline page painter password passwords PCI policy poll pricing privacy PROXY publish publisher publsher PWA redirect Redundancy release release-notes Report Tool Reports Responsive ReST RESTFul Rich text RSS Safari sandbox sanity schedule scrum search security SEO sessions setup shipping site builder source spell SQL Injection SSL SSO standards store stSoftware support survey Swagger Task template testimonial Threads timezone tinyMCE Transaction Search trigger twitter twitter bootstrap Ubuntu unit tests unsubscribe URL validation WC3 AAA web folders web services webdav windows 8 wizard workflow WYSIWYG XLS XLST XML XPath XSS

    How to check your ReST service returns expected format/values?

    Use sanity checks to test your ReST services and variables

     You can view all the ReST services and their details via CMS/RESTful API

     

    You can also try or edit a ReST service here 

     To set up a sanity check for a ReST service, click the "Edit" button, and go to "Sanity" tab

    Click "Add" button to add a new sanity check or click one check to edit it.

    Enter the additional path, and all parameters, the results section will show you the response status and response JSON

     

    Click "Add" button in the "Checks" section to add one check for this sanity check. Enter the JSON Path you'd like to check and RegEx pattern for expected value, the results will be shown in the Results section.

    Valid JSON Path could be:

    • $ - shows the whole JSON Object or JSON Array
    • $[0] - shows the first element in the root JSON Array
    • $.results[0].folderid.path - shows the folderid.path of the first element in the results attribute

     

    You also could add sanity check for a rest variable. Go to Variables tab in the ReST Definition data entry screen 

     

    Click a variable to open the variable data entry screen 

     

     You may have some logic to parse the variable values in the Parse tab. The screen shot shows a parser that adds double quotes for each country code

    You can add variable sanity checks in the Sanity tab

     Enter test value, and expected response status code and RegEx pattern for the expected values to test