Skip to content

Commit

Permalink
Merge branch 'hello-weiran-issue1364'
Browse files Browse the repository at this point in the history
  • Loading branch information
epoberezkin committed Jan 2, 2021
2 parents 9200e92 + c44597e commit 78cc974
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Please review [Contributing guidelines](./CONTRIBUTING.md) and [Code components]
- [Frequently Asked Questions](./docs/faq.md)
- [Using in browser](#using-in-browser)
- [Content Security Policy](./docs/security.md#content-security-policy)
- [Using in ES5 environment](#using-in-es5-environment)
- [Command line interface](#command-line-interface)
- [API reference](./docs/api.md)
- [Methods](./docs/api.md#ajv-constructor-and-methods)
Expand Down Expand Up @@ -307,6 +308,19 @@ The browser bundle is available on [cdnjs](https://cdnjs.com/libraries/ajv).

**Please note**: some frameworks, e.g. Dojo, may redefine global require in a way that is not compatible with CommonJS module format. In this case Ajv bundle has to be loaded before the framework and then you can use global `ajv` (see issue [#234](https://github.com/ajv-validator/ajv/issues/234)).

## Using in ES5 environment

You need to:

- recompile Typescript to ES5 target - it is set to 2018 in the bundled compiled code.
- generate ES5 validation code:

```javascript
const ajv = new Ajv({code: {es5: true}})
```

See [Advanced options](https://github.com/ajv-validator/ajv/blob/master/docs/api.md#advanced-options).

## Command line interface

CLI is available as a separate npm package [ajv-cli](https://github.com/ajv-validator/ajv-cli). It supports:
Expand Down
6 changes: 5 additions & 1 deletion lib/vocabularies/applicator/oneOf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import {_, Name} from "../../compile/codegen"
import {alwaysValidSchema} from "../../compile/util"
import {SchemaCxt} from "../../compile"

export type OneOfError = ErrorObject<"oneOf", {passingSchemas: [number, number] | null}, AnySchema[]>
export type OneOfError = ErrorObject<
"oneOf",
{passingSchemas: [number, number] | null},
AnySchema[]
>

const error: KeywordErrorDefinition = {
message: "should match exactly one schema in oneOf",
Expand Down

0 comments on commit 78cc974

Please sign in to comment.