Share your code.
This package has been deprecated
not to be used anymore
- Node (6.9.5 or higher)
- Node Package Manager
- Typescript (2.3.0 or higher)
How to build
The first step would be to run
npm install so we have all the required modules installed.
How to test
This runs the tests under tests directory.
How to write a new validation rule
- Add a typescript file under
azure-openapi-linterdirectory named same as the name of the rule. Add the
appliesTo_JsonQueryproperties to the rule.
appliesTo_JsonQueryis the node(s) to which the rule needs to be applied. This is evaluated using JsonPaths. Please refer here for a brief tutorial about JsonPaths.
- Next, implement the
runmethod under the rule that actually does the validation. Add a reference to this script file under
- Lastly add a test case for the validation rule, by adding a test json/yaml under
src\azure-openapi-linter\tests\resourcesand a script under
src\azure-openapi-linter\testsdepending on the type of the validation rule.