# More specific validation

Well, the fields are being validated, but the validation is too lenient. It can be much more robust and focused. We can think of the following rules:

* <mark style="color:blue;">`name`</mark> - Between two and fifty characters. We can achieve this with <mark style="color:blue;">`@Length(2, 50)`</mark>.
* <mark style="color:blue;">`email`</mark> - Must be a valid email. We can use <mark style="color:blue;">`@IsEmail()`</mark>.
* <mark style="color:blue;">`phone`</mark> - Must be a valid phone number. We can use <mark style="color:blue;">`@IsPhoneNumber()`</mark>, and even define a <mark style="color:blue;">`region`</mark>, like US.
* <mark style="color:blue;">`password`</mark> - In a future moment, we'll validate it using <mark style="color:blue;">`@Matches()`</mark> and a **regex** for interesting, custom validation. For now, let's leave it as it is.

> It can be a great idea to check on the [available validators](https://github.com/typestack/class-validator#validation-decorators), you may find something interesting.


---

# 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://kinesis-school-of-programming.gitbook.io/nestjs-unleashed/core-module-backend-development-with-nestjs/validation/more-specific-validation.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.
