Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ajv-validator/ajv
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.2.3
Choose a base ref
...
head repository: ajv-validator/ajv
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.2.4
Choose a head ref
  • 4 commits
  • 4 files changed
  • 2 contributors

Commits on Mar 24, 2021

  1. Updated options docs link.

    radekmie authored Mar 24, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c0b2476 View commit details
  2. Merge pull request #1511 from radekmie/patch-1

    Updated options docs link.
    epoberezkin authored Mar 24, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    46d91d7 View commit details

Commits on Mar 26, 2021

  1. Copy the full SHA
    6014412 View commit details
  2. 7.2.4

    epoberezkin committed Mar 26, 2021
    Copy the full SHA
    d658548 View commit details
Showing with 31 additions and 3 deletions.
  1. +1 −1 docs/api.md
  2. +1 −1 lib/compile/util.ts
  3. +1 −1 package.json
  4. +28 −0 spec/issues/1515_evaluated_properties_nested_anyof.spec.ts
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
@@ -495,4 +495,4 @@ const ajv = new Ajv({

##### Options

This section is moved to [Initialization options](./options) page
This section is moved to [Initialization options](./options.md) page
2 changes: 1 addition & 1 deletion lib/compile/util.ts
Original file line number Diff line number Diff line change
@@ -128,7 +128,7 @@ export const mergeEvaluated: MergeEvaluated = {
gen.if(
_`${from} === true`,
() => gen.assign(to, true),
() => gen.code(_`Object.assign(${to}, ${from})`)
() => gen.assign(to, _`${to} || {}`).code(_`Object.assign(${to}, ${from})`)
)
}),
mergeToName: (gen, from, to) =>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ajv",
"version": "7.2.3",
"version": "7.2.4",
"description": "Another JSON Schema Validator",
"main": "dist/ajv.js",
"types": "dist/ajv.d.ts",
28 changes: 28 additions & 0 deletions spec/issues/1515_evaluated_properties_nested_anyof.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import _Ajv from "../ajv2019"
import * as assert from "assert"

describe("tracking evaluated properties with nested anyOf", () => {
it("should initialize evaluated properties", () => {
const ajv = new _Ajv()

const schema = {
type: "object",
anyOf: [
{
required: ["foo"],
properties: {foo: {}},
},
{
anyOf: [
{
properties: {bar: {}},
},
],
},
],
}

const validate = ajv.compile(schema)
assert.strictEqual(validate({bar: 1}), true)
})
})