Thank you for your help making Ajv better! Every contribution is appreciated. If you plan to implement a new feature or some other change please create an issue first, to make sure that your work is not lost.
Ajv has a lot of features and maintaining documentation takes time. I appreciate the time you spend correcting or clarifying the documentation.
Before submitting the issue please search the existing issues and also review Frequently Asked Questions.
I would really appreciate the time you spend providing all the information and reducing both your schema and data to the smallest possible size when they still have the issue. Simplifying the issue also makes it more valuable for other users (in cases it turns out to be an incorrect usage rather than a bug).
Please make sure to include the following information in the issue:
- What version of Ajv are you using? Does the issue happen if you use the latest version?
- Ajv options object (see https://github.com/epoberezkin/ajv#options).
- JSON Schema and the data you are validating (please make it as small as possible to reproduce the issue).
- Your code (please use
options
,schema
anddata
as variables). - Validation result, data AFTER validation, error messages.
- What results did you expect?
Create a proposal for a new feature, option or some other improvement.
Please include this information:
- The version of Ajv you are using.
- The problem you want to solve.
- What do you think is the correct solution to problem?
- Will you be able to implement it?
If you’re requesting a change, it would be helpful to include this as well:
- What you did.
- What you would like to happen.
- What actually happened.
Please include as much details as possible.
Create an issue to report a compatibility problem that only happens in a particular environment (when your code works correctly in node.js v8+ in linux systems but fails in some other environment).
Please include this information:
- The version of Ajv you are using.
- The environment you have the problem with.
- Your code (please make it as small as possible to reproduce the issue).
- If your issue is in the browser, please list the other packages loaded in the page in the order they are loaded. Please check if the issue gets resolved (or results change) if you move Ajv bundle closer to the top.
- Results in node.js v8+.
- Results and error messages in your platform.
Create an issue to report problems that happen during Ajv installation or when Ajv is missing some dependency.
Before submitting the issue, please try the following:
- use the latest stable Node.js and
npm
- use
yarn
instead ofnpm
- the issue can be related to npm/npm#19877 - remove
node_modules
andpackage-lock.json
and run install again
If nothing helps, please submit:
- The version of Ajv you are using
- Operating system and node.js version
- Package manager and its version
- Link to (or contents of) package.json
- Error messages
- The output of
npm ls
Ajv implements JSON Schema standard draft-04 and draft-06/07.
If it is a general issue related to using the standard keywords included in JSON Schema or implementing some advanced validation logic please ask the question on Stack Overflow (my account is esp) or submitting the question to JSON-Schema.org. Please mention @epoberezkin.
The best place to ask a question about using Ajv is Gitter chat.
If the question is advanced, it can be submitted to Stack Overflow.
Thanks a lot for considering contributing to Ajv. Many very useful features were created by its users.
Running tests:
npm install
git submodule update --init
npm test
The full test suite runs for 3 minutes. If your change is trivial you can run quick test before committing (10 sec) and then disable pre-commit hook:
npm run test-fast
git commit -nm 'type: message'
All validation functions are generated using doT templates in dot folder. Templates are precompiled so doT is not a run-time dependency.
npm run build
- compiles templates to dotjs folder.
npm run watch
- automatically compiles templates when files in dot folder change
To make accepting your changes faster please follow these steps:
- Submit an issue with the bug or with the proposed change (unless the contribution is to fix the documentation typos and mistakes).
- Please describe the proposed api and implementation plan (unless the issue is a relatively simple bug and fixing it doesn't change any api).
- Once agreed, please write as little code as possible to achieve the desired result.
- Please avoid unnecessary changes, refactoring or changing coding styles as part of your change (unless the change was proposed as refactoring).
- Please follow the coding conventions even if they are not validated (and/or you use different conventions in your code).
- Please run the tests before committing your code.
- If tests fail in Travis after you make a PR please investigate and fix the issue.
When contributing the code you confirm that:
- Your contribution is created by you.
- You have the right to submit it under the MIT license.
- You understand and agree that your contribution is public, will be stored indefinitely, can be redistributed as the part of Ajv or another related package under MIT license, modified or completely removed from Ajv.
- You grant irrevocable MIT license to use your contribution as part of Ajv or another related package.
- You waive all rights to your contribution.
- Unless you request otherwise, you can be mentioned as the author of the contribution in the Ajv documentation and change log.