# Strict Mode

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

## Contents

* [Strict Mode](#strict-mode)
  * [What is Strict Mode](#what-is-strict-mode)
  * [Usage of Strict Mode](#usage-of-strict-mode)
  * [Related Topics](#related-topics)

***

### 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.

![StrictMode](/files/SOBQyHlPeINxgQvYjKHo)

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.

![WrongData](/files/HjKKxAPGdzQWaDR93VYB)

Hit the request and see the result.

![WrongDataOutput](/files/PRqmC1GNk46SgywkFloJ)

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.

![RightDataResult](/files/ftOgAVcphhQCeKVmMq25)

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](/service-virtualization/dynamic-assets/build-dynamic-asset.md)
* [Global Variable](/service-virtualization/advanced-features/global-variable.md)
* [Parameterization](/service-virtualization/advanced-features/parameterization.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.qyrus.com/service-virtualization/advanced-features/strict-mode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
