Skip to content

Commit

Permalink
Fix broken links (#1753)
Browse files Browse the repository at this point in the history
  • Loading branch information
asaid-0 authored Sep 12, 2021
1 parent 658e7a1 commit d95fc92
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if (validate(data)) {
}
```

See more advanced example in [the test](../spec/types/json-schema.spec.ts).
See more advanced example in [the test](https://github.com/ajv-validator/ajv/blob/master/spec/types/json-schema.spec.ts).

<a name="jtd-serialize"></a>

Expand Down Expand Up @@ -385,7 +385,7 @@ if (validate(data)) {
}
```

Also see an example in [this test](../spec/types/error-parameters.spec.ts)
Also see an example in [this test](https://github.com/ajv-validator/ajv/blob/master/spec/types/error-parameters.spec.ts)

- `maxItems`, `minItems`, `maxLength`, `minLength`, `maxProperties`, `minProperties`:

Expand Down
4 changes: 2 additions & 2 deletions docs/codegen.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if (num0 > 0) {
}
```

`.const`, `.if` and `.code` above are methods of CodeGen class that generate code inside class instance `gen` - see [source code](https://github.com/ajv-validator/ajv/blob/master/lib/compile/codegen/index.ts) for all available methods and [tests](../spec/codegen.spec.ts) for other code generation examples.
`.const`, `.if` and `.code` above are methods of CodeGen class that generate code inside class instance `gen` - see [source code](https://github.com/ajv-validator/ajv/blob/master/lib/compile/codegen/index.ts) for all available methods and [tests](https://github.com/ajv-validator/ajv/blob/master/spec/codegen.spec.ts) for other code generation examples.

These methods only accept instances of private class `_Code`, other values will be rejected by Typescript compiler - the risk to pass unsafe string is mitigated on type level.

Expand All @@ -72,7 +72,7 @@ CodeGen class generates code trees and performs several optimizations before the
These optimizations assume that the expressions in `if` conditions, `for` statement headers and assigned expressions are free of any side effects - this is the case for all pre-defined validation keywords.
:::

See [these tests](../spec/codegen.spec.ts) for examples.
See [these tests](https://github.com/ajv-validator/ajv/blob/master/spec/codegen.spec.ts) for examples.

By default Ajv does 1-pass optimization - based on the test suite it reduces the code size by 10.5% and the number of tree nodes by 16.7% (TODO benchmark the validation time). The second optimization pass changes it by less than 0.1%, so you won't need it unless you have really complex schemas or if you generate standalone code and want it to pass relevant eslint rules.

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/combining-schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const ajv = new Ajv2019({
const validate = ajv.getSchema("https://example.com/strict-tree")
```

See [dynamic-refs](../spec/dynamic-ref.spec.ts) test for the example using `$dynamicAnchor`/`$dynamicRef`.
See [dynamic-refs](https://github.com/ajv-validator/ajv/blob/master/spec/dynamic-ref.spec.ts) test for the example using `$dynamicAnchor`/`$dynamicRef`.

At the moment Ajv implements the spec for dynamic recursive references with these limitations:

Expand Down
2 changes: 1 addition & 1 deletion docs/keywords.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ ajv.addKeyword({
})
```

Macro keywords an be recursive - i.e. return schemas containing the same keyword. See the example of defining a recursive macro keyword `deepProperties` in the [test](../spec/keyword.spec.ts#L316).
Macro keywords an be recursive - i.e. return schemas containing the same keyword. See the example of defining a recursive macro keyword `deepProperties` in the [test](https://github.com/ajv-validator/ajv/blob/master/spec/keyword.spec.ts#L316).

## Schema compilation context

Expand Down

0 comments on commit d95fc92

Please sign in to comment.