diff --git a/content/2020-12/applicator/additionalProperties.markdown b/content/2020-12/applicator/additionalProperties.markdown index 5c05d93..429d517 100644 --- a/content/2020-12/applicator/additionalProperties.markdown +++ b/content/2020-12/applicator/additionalProperties.markdown @@ -41,9 +41,9 @@ related: keyword: unevaluatedProperties --- -The `additionalProperties` keyword is used to control the handling of properties whose names are not listed in the `properties` keyword or match any of the regular expressions in the `patternProperties` keyword. By default any additional properties are allowed. +The {{}} keyword is used to control the handling of properties whose names are not listed in the {{}} keyword or match any of the regular expressions in the {{}} keyword. By default any additional properties are allowed. -The behavior of this keyword depends on the presence and annotation results of `properties` and `patternProperties` within the same schema object. Validation with `additionalProperties` applies only to the child values of instance names that do not appear in the annotation results of either `properties` or `patternProperties`. +The behavior of this keyword depends on the presence and annotation results of {{}} and {{}} within the same schema object. Validation with {{}} applies only to the child values of instance names that do not appear in the annotation results of either {{}} or {{}}. ## Examples @@ -68,7 +68,7 @@ The behavior of this keyword depends on the presence and annotation results of ` {{}} { "foo": "foo", "bar": "bar" } {{}} -* _When `additionalProperties` is set to false, all the instance properties must either be present in the `properties` or match any regex within `patternProperties`; otherwise, the validaion will fail._ +* _When {{}} is set to false, all the instance properties must either be present in the {{}} or match any regex within {{}}; otherwise, the validaion will fail._ {{}} { @@ -94,7 +94,7 @@ The behavior of this keyword depends on the presence and annotation results of ` {{}} { "name": "John Doe", "age": "21" } {{}} -* _The value of `additionalProperties` can either be a boolean schema or an object schema._ +* _The value of {{}} can either be a boolean schema or an object schema._ {{}} { @@ -131,7 +131,7 @@ The behavior of this keyword depends on the presence and annotation results of ` { "keyword": "/patternProperties", "instance": "", "value": [ "Age" ] } { "keyword": "/additionalProperties", "instance": "", "value": [ "email" ] } {{}} -* _Instance properties (keys) not present in `properties` or not matching any regex within `patternProperties` are evaluated against `additionalProperties`._ +* _Instance properties (keys) not present in {{}} or not matching any regex within {{}} are evaluated against {{}}._ {{}} { @@ -175,4 +175,4 @@ The behavior of this keyword depends on the presence and annotation results of ` { "keyword": "/patternProperties", "instance": "", "value": [ "Age" ] } {{}} - _**Note:** JSON Schema is a constraint language and if you don't limit keywords like this, then more keywords than what you defined in `properties`, etc would be allowed. If you don't define a property using `properties` or `patternProperties`, but don't disallow it with `additionalProperties`, it would still be valid with any value._ + _**Note:** JSON Schema is a constraint language and if you don't limit keywords like this, then more keywords than what you defined in {{}}, etc would be allowed. If you don't define a property using {{}} or {{}}, but don't disallow it with {{}}, it would still be valid with any value._ diff --git a/content/2020-12/applicator/allOf.markdown b/content/2020-12/applicator/allOf.markdown index dce1789..1728e13 100644 --- a/content/2020-12/applicator/allOf.markdown +++ b/content/2020-12/applicator/allOf.markdown @@ -28,7 +28,7 @@ related: keyword: not --- -The `allOf` keyword is used to specify that a given instance must validate against all of the subschemas provided within an array. It's essentially a logical "AND" operation where all conditions must be met for validation to pass. +The {{}} keyword is used to specify that a given instance must validate against all of the subschemas provided within an array. It's essentially a logical "AND" operation where all conditions must be met for validation to pass. ## Examples @@ -129,7 +129,7 @@ The `allOf` keyword is used to specify that a given instance must validate again {{}} { "foo": "foo" } {{}} -* _Remember, if any subschema within the `allOf` keyword fails validation or has a boolean `false` value, the entire validation will always fail._ +* _Remember, if any subschema within the {{}} keyword fails validation or has a boolean `false` value, the entire validation will always fail._ {{}} { diff --git a/content/2020-12/applicator/anyOf.markdown b/content/2020-12/applicator/anyOf.markdown index bd9382d..e3d81d9 100644 --- a/content/2020-12/applicator/anyOf.markdown +++ b/content/2020-12/applicator/anyOf.markdown @@ -28,7 +28,7 @@ related: keyword: not --- -The `anyOf` keyword in JSON Schema is used to specify that an instance must validate against at least one of the schemas provided in an array. It allows you to define multiple schemas, and if the data validates against any one of them, the validation passes. +The {{}} keyword in JSON Schema is used to specify that an instance must validate against at least one of the schemas provided in an array. It allows you to define multiple schemas, and if the data validates against any one of them, the validation passes. ## Examples @@ -133,7 +133,7 @@ The `anyOf` keyword in JSON Schema is used to specify that an instance must vali {{}} { "foo": true } {{}} -* _Remember, if any subschema within the `anyOf` keyword passes validation or has a boolean `true` value, the overall result of `anyOf` is considered valid._ +* _Remember, if any subschema within the {{}} keyword passes validation or has a boolean `true` value, the overall result of {{}} is considered valid._ {{}} { @@ -160,15 +160,15 @@ The `anyOf` keyword in JSON Schema is used to specify that an instance must vali {{}} 10 {{}} -* _For the first instance above, validation passes against the first subschema within `anyOf`, thereby making the `anyOf` keyword valid, regardless of the validation result against the second subschema._ +* _For the first instance above, validation passes against the first subschema within {{}}, thereby making the {{}} keyword valid, regardless of the validation result against the second subschema._ -* _Similarly, for the second instance above, validation passes against the first subschema within `anyOf`. Even though the instance does not conform to the second subschema, validation does not proceed to validate against it, as it has already been successfully validated against the first subschema. Thus, the validation stops at that point, rendering the `anyOf` valid, despite the instance not conforming to the second subschema within the `anyOf`._ +* _Similarly, for the second instance above, validation passes against the first subschema within {{}}. Even though the instance does not conform to the second subschema, validation does not proceed to validate against it, as it has already been successfully validated against the first subschema. Thus, the validation stops at that point, rendering the {{}} valid, despite the instance not conforming to the second subschema within the {{}}._ {{}} Important note on performance and annotations: -* When running validation only, a JSON Schema implementation may stop validating `anyOf` when it encounters a successful one. However, when collecting annotations, it must evaluate all of them. -* The process of collecting annotations can impact runtime performance. For instance, if you collect annotations on a JSON Schema utilizing the `anyOf` applicator, the implementation is forced to evaluate the instance against every disjunction in the `anyOf` applicator. Conversely, if annotations are not collected, implementations may stop evaluation as soon as one `anyOf` subschema successfully validates against the instance. +* When running validation only, a JSON Schema implementation may stop validating {{}} when it encounters a successful one. However, when collecting annotations, it must evaluate all of them. +* The process of collecting annotations can impact runtime performance. For instance, if you collect annotations on a JSON Schema utilizing the {{}} applicator, the implementation is forced to evaluate the instance against every disjunction in the {{}} applicator. Conversely, if annotations are not collected, implementations may stop evaluation as soon as one {{}} subschema successfully validates against the instance. * In the interest of runtime efficiency, we recommend collecting annotations only if your specific use case demands it. {{}} diff --git a/content/2020-12/applicator/contains.markdown b/content/2020-12/applicator/contains.markdown index 1a6b169..00b4da7 100644 --- a/content/2020-12/applicator/contains.markdown +++ b/content/2020-12/applicator/contains.markdown @@ -35,13 +35,13 @@ related: keyword: unevaluatedItems --- -The `contains` keyword is used to check if at least one element in an array instance validates against a specified sub-schema. It offers flexibility compared to `items`, which requires all elements to adhere to a single schema. +The {{}} keyword is used to check if at least one element in an array instance validates against a specified sub-schema. It offers flexibility compared to {{}}, which requires all elements to adhere to a single schema. -An array instance is valid against `contains` if at least one of its elements is valid against the given schema, except when `minContains` is present and has a value of 0, in which case an array instance must be considered valid against the `contains` keyword, even if none of its elements is valid against the given schema. +An array instance is valid against {{}} if at least one of its elements is valid against the given schema, except when {{}} is present and has a value of 0, in which case an array instance must be considered valid against the {{}} keyword, even if none of its elements is valid against the given schema. -Similarly, if `maxContains` is present alongside `contains`, the instance will be considered valid as long as the number of elements successfully validating against the `contains` subschema does not exceed the specified limit defined by `maxContains`. +Similarly, if {{}} is present alongside {{}}, the instance will be considered valid as long as the number of elements successfully validating against the {{}} subschema does not exceed the specified limit defined by {{}}. -* For data validation, `items` validates all array elements against a single schema, `prefixItems` validates a fixed-length sequence at the array's beginning, and `contains` checks for at least one element matching a schema anywhere in the array. +* For data validation, {{}} validates all array elements against a single schema, {{}} validates a fixed-length sequence at the array's beginning, and {{}} checks for at least one element matching a schema anywhere in the array. * The subschema must be applied to every array element, even after the first match has been found, to collect annotations for use by other keywords. ## Examples diff --git a/content/2020-12/applicator/dependentSchemas.markdown b/content/2020-12/applicator/dependentSchemas.markdown index fba10ce..aec2f0f 100644 --- a/content/2020-12/applicator/dependentSchemas.markdown +++ b/content/2020-12/applicator/dependentSchemas.markdown @@ -20,7 +20,7 @@ related: keyword: dependentRequired --- -The `dependentSchemas` keyword allows you to define dependencies between properties based on the presence of other properties within an instance. It extends the functionality of the `dependentRequired` keyword by allowing you to pass in a full schema. The instance will be considered valid only if the dependent properties adhere to the `dependentSchemas` schema. +The {{}} keyword allows you to define dependencies between properties based on the presence of other properties within an instance. It extends the functionality of the {{}} keyword by allowing you to pass in a full schema. The instance will be considered valid only if the dependent properties adhere to the {{}} schema. * Each key in the object represents a property name. * Instance is valid if the associated property is present and conforms to the subschema. diff --git a/layouts/shortcodes/keyword-link.html b/layouts/shortcodes/keyword-link.html new file mode 100644 index 0000000..2c54e5f --- /dev/null +++ b/layouts/shortcodes/keyword-link.html @@ -0,0 +1,15 @@ +{{- $keyword := .Get "name" -}} +{{- $keywordMap := dict -}} +{{- range $.Site.RegularPages -}} + {{- $dialect := .Section -}} + {{- $vocabulary := .Parent.Title -}} + {{- $keywordParam := .Params.keyword -}} + {{- $url := .Permalink -}} + {{- $keywordMap = $keywordMap | merge (dict $keywordParam $url) -}} +{{- end -}} +{{- $url := index $keywordMap $keyword -}} +{{- if $url -}} + {{ $keyword }} +{{- else -}} + {{ $keyword }} +{{- end -}} \ No newline at end of file