Service Virtualization
Documentation Home
  • Overview
  • Getting-Started-With-Service-Virtualization
    • Intro-to-SV
    • Creating SV Project
  • Dynamic-Assets
    • Advanced Mode
    • Building Dynamic Asset
    • Dynamic Asset
  • Manual-Assets
    • Build Asset Manually
    • Build New Request
    • Import Manual Asset
    • Manage and Send Request
    • Manual Asset
  • Advanced-Features
    • Global Variable
    • Parameterization
    • Strict Mode
  • FAQs
    • FAQs
Powered by GitBook
On this page
  • Contents
  • What is Strict Mode
  • Usage of Strict Mode
  • Related Topics
  1. Advanced-Features

Strict Mode

Last updated 1 year ago

Don't worry if your Request body lacks schema validation – Qyrus has a solution with strict mode in Dynamic asset to support you.

Contents


What is Strict Mode

Let's grasp this concept using an example.

Imagine your Dynamic asset has three fields company, country, and city. Now, if you try to add a fourth field called street in the request body for POST call, the request shouldn't be accepted, and an error should be shown. This is exactly what strict mode accomplishes for you!

Let's continue the above example and observe the outcomes when Strict Mode is turned on and off.

  • Strict Mode is on:

    • You can't provide extra fields in the request body.

    • You can't miss any existing field in the request body.

    • You can't change the field name in the request body.

  • Strict Mode is off:

    • You can provide extra fields in the request body.

    • You can remove any existing field in the request body.

    • You can change the field name in the request body.

Now Let's see how it works!


Usage of Strict Mode

You will discover the Strict Mode toggle on the dynamic asset page in basic mode, just like it's displayed in the image below.

Now let's check what happens when we hit Post request with the wrong request body data. In the request body, I've added an extra field which is wrong when strict mode is on.

Hit the request and see the result.

As discussed and shown in the above image, the Status Code is 500 and the Error Message is also there.

Now let's check what happens when we hit the same request again but with the strict mode is off.

As discussed and shown in the above image, Status Code is 201 and Data is created.

Pretty cool, huh? You can delve deeper into strict mode using various examples.


Related Topics

Build Dynamic Asset with Basic Mode
Global Variable
Parameterization
Strict Mode
What is Strict Mode
Usage of Strict Mode
Related Topics
StrictMode
WrongData
WrongDataOutput
RightDataResult