From d95fc929a8ae5205fe8b9daa6e6d6a9593f105ea Mon Sep 17 00:00:00 2001 From: Elsaid Achraf <60660214+asaid-0@users.noreply.github.com> Date: Sun, 12 Sep 2021 11:26:17 +0200 Subject: [PATCH] Fix broken links (#1753) --- docs/api.md | 4 ++-- docs/codegen.md | 4 ++-- docs/guide/combining-schemas.md | 2 +- docs/keywords.md | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/api.md b/docs/api.md index 8f35083c4..33ea7af9a 100644 --- a/docs/api.md +++ b/docs/api.md @@ -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). @@ -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`: diff --git a/docs/codegen.md b/docs/codegen.md index b231a951c..e222e288e 100644 --- a/docs/codegen.md +++ b/docs/codegen.md @@ -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. @@ -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. diff --git a/docs/guide/combining-schemas.md b/docs/guide/combining-schemas.md index 91e97da89..7937fe150 100644 --- a/docs/guide/combining-schemas.md +++ b/docs/guide/combining-schemas.md @@ -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: diff --git a/docs/keywords.md b/docs/keywords.md index b283fa7f7..55d550ea1 100644 --- a/docs/keywords.md +++ b/docs/keywords.md @@ -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