Forum Discussion

frankkDLL's avatar
frankkDLL
Occasional Contributor
8 years ago

REST Request validation in Virt Server

Hi There,

 

Just wondering what is the best method for applying compliance assertions to an inbound REST requests to a virt? On the incoming settings section, it gives the ability to add assertions but the assertions I am after are disabled (e.g. JSON Schema Compliance, Swagger Compliance Assertion). Is there anyway to enable these? 

 

Also the placeholder comment "use assertions for response validation" is a little misleading for a newbie.

 

Rgds,

Frank

4 Replies

    • frankkDLL's avatar
      frankkDLL
      Occasional Contributor

      Hi Tanya,

       

      Thanks for the response. This is a little confusing as the description of the Swagger assertion states "Asserts that the request and response messages are compliant with a swagger definition"

       

      It's quite a normal expectation that the request body for operations like PUT, PATCH, POST could be validated for compliance. Sames goes for other operations, query parameters, headers etc.

       

      Using Service-V for API sandboxing should facilitate that we can act like the API provide and easily validate requests and give appropriate responses as defined in the swagger definitions without having to script all the validations by hand.

       

      Any recommendations on the best way to achieve?

       

      Kind regards,

      Frank