Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Validation-and-Serialization.md #1094

Merged
merged 1 commit into from Aug 26, 2018
Merged

Conversation

cemremengu
Copy link
Contributor

Explains #1093

Checklist

  • documentation is changed or added
  • commit message and code follows Code of conduct

Copy link
Member

@allevo allevo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Could you add a link to ajv website too? https://ajv.js.org/

@@ -109,16 +109,28 @@ The function `getSchemas` returns all shared schemas that were added by `addSche

The `schemaCompiler` is a function that returns a function that validates the body, url parameters, headers, and query string. The default `schemaCompiler` returns a function that implements the `ajv` validation interface. Fastify uses it internally to speed the validation up.

While you cannot change the configuration options of the default `ajv` instance, you can create your own:
The configuration options of the default fastify `ajv` instance are set as
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"fastify" => "Fastify"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, just replace the sentence with:

"Fastify's baseline ajv configuration is:"

}
```

and cannot be changed. If you want to change or set additional config options, you will need to create your own instance and override the existing one like:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"and cannot be changed." => "This baseline configuration cannot be modified."

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@delvedor delvedor added the documentation Improvements or additions to documentation label Aug 26, 2018
@mcollina
Copy link
Member

@jsumners are you good with this?

Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@delvedor delvedor merged commit ba9a629 into fastify:master Aug 26, 2018
@cemremengu cemremengu deleted the patch-1 branch August 26, 2018 12:20
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants