ajv/spec/custom_rules
Richard Taylor 66db560ca5 Allow custom keywords that are not valid JS identifiers
Custom keywords were required to be valid JS identifiers due to the
way they were being used in the generated code.  This prevented the use
of keywords with the `x-` prefix that is required by [swagger](http://swagger.io].

This change fixes that by updating the only place that was using them
directly as an identifier to use //brackets// notation rather than
//dot// notation.  This brings the definition of `$schemaPath` in
`definitions.def` in line with the way the rule definition is accessed
from `RULES.custom` at the top of `custom.jst`.

The validation of the keyword name has been changed to allow any name
in this change, but this should be updated to either just remove the
test or update it to a new rule before this change is included in
the project.

Finally, this also updates a number of the tests in `custom.spec.js` to
use non-valid identifiers for the names of some of the custom keywords
being tested (primarily by adding `x-` to the front of the name).

Test Plan:
- Run `npm test` and ensure all tests run and pass
2017-01-05 10:48:12 +00:00
..
index.js fixed browser tests with the new brfs version 2016-01-26 13:18:50 +00:00
range.jst Allow custom keywords that are not valid JS identifiers 2017-01-05 10:48:12 +00:00
range_with_errors.jst Allow custom keywords that are not valid JS identifiers 2017-01-05 10:48:12 +00:00