Back to the specification
Conformance tests: Working Draft 1.x
- /conf/formats/detect-aas2-6: A document with
asyncapi: 2.6.0 is aas2_6 and not aas2_5. - /conf/formats/detect-aas2-needs-patch:
asyncapi: "2.6" without a patch number is not aas2, while 2.6.0 is. - /conf/formats/detect-arazzo: A document with
arazzo: 1.0.1 is arazzo1_0. - /conf/formats/detect-json-schema-2020-12: A
$schema of draft 2020-12 is jsonSchemaDraft2020_12 and not draft 7. - /conf/formats/detect-json-schema-loose: A document with
type: object and no $schema is jsonSchemaLoose but not jsonSchema. - /conf/formats/detect-number-version: An unquoted
openapi: 3.0 is the number 3, whose string form is 3, so the document is oas3 but not oas3_0. - /conf/formats/detect-oas2: A document with
swagger: "2.0" is oas2 and not oas3. - /conf/formats/detect-oas3-1: An OpenAPI 3.1 document is detected as
oas3_1 and not as oas3_0. - /conf/formats/detection-declared-only:
oas3_1 is not detected when no rule names it, so for an OpenAPI 3.1 document the alias uses its oas3 target, though an oas3_1 target comes last. - /conf/formats/rule-overrides-ruleset: A rule's own
formats replaces the ruleset's. - /conf/formats/rule-scope: Of two rules scoped to different formats, only the one whose format the document has runs.
- /conf/formats/ruleset-default: A rule without
formats takes the ruleset's, so it does not run on a document of another format, while a rule scoped to that format does. - /conf/formats/shape-string: A ruleset whose
formats is a string is invalid. - /conf/formats/shape-valid:
formats as an array of strings on the ruleset, a rule, an override, and an alias target is valid. - /conf/formats/unknown-identifier: A rule whose
formats names an identifier outside the table, oas31, is invalid. - /conf/formats/unrecognized-document: A document that has none of the ruleset's formats gets one warning and no rule results.
- /conf/formats/unrecognized-unscoped: A document with none of the ruleset's formats gets the warning, the ruleset's own rule does not run, and an unscoped rule from an extended ruleset does.
- /conf/formats/unscoped: Without
formats anywhere, a rule runs on a document of no known format.
- /conf/functions/alphabetical:
alphabetical fails on an unsorted array and passes on a sorted one. - /conf/functions/alphabetical-case: Strings are compared with
localeCompare, so a comes before B and B after a. - /conf/functions/alphabetical-keyed-by: With
keyedBy, an array of objects is compared by that property. - /conf/functions/alphabetical-numbers: Numbers are compared by value, so
[2, 10] is in order and [10, 9] is not. - /conf/functions/casing:
casing with type: kebab fails on a camel-case string. - /conf/functions/casing-non-ascii: Only ASCII letters count, so
éclair is not camel case; the empty string passes. - /conf/functions/casing-types: Each case accepts a value written in it and rejects one written in another case.
- /conf/functions/defined:
defined fails on an absent property and passes on a present one. - /conf/functions/enumeration:
enumeration fails on a value outside values. - /conf/functions/enumeration-types:
"1" is not one of [1], while 1.0 is. - /conf/functions/falsy:
falsy fails on an empty array, an empty object, and a string, and passes on false, "", 0, and null. - /conf/functions/input-types:
pattern passes on a number and on an absent value, and fails only on the string that does not match; xor passes on a string. - /conf/functions/length:
length with max: 4 fails on a string of six characters and an array of five elements, and passes on a number below the bound. - /conf/functions/length-code-units: A string's length is its number of UTF-16 code units:
é is one, an emoji two. - /conf/functions/length-min:
length with min: 2 fails on an object with one property and a string of one character, and passes on an object with two. - /conf/functions/or:
or fails unless at least one of properties is present. - /conf/functions/or-null: A key whose value is null counts as present, so
{a: null} satisfies or and {} does not. - /conf/functions/pattern:
match fails on a string that does not match, notMatch fails on one that does. - /conf/functions/schema:
schema fails on a value that does not validate against the given JSON Schema. - /conf/functions/schema-absent:
schema fails on an absent value. - /conf/functions/schema-all-errors: With
allErrors: true, a value that fails two keywords gets two problems. - /conf/functions/schema-default-draft: Without
$schema or dialect, the schema is read as draft 7: prefixItems is ignored, required is not. - /conf/functions/schema-dialect: With
dialect: draft2020-12, prefixItems applies. - /conf/functions/schema-first-error: Without
allErrors, a value that fails two keywords gets one problem. - /conf/functions/schema-format: The
format keyword is asserted, so not-an-email fails format: email. - /conf/functions/schema-ref: A
$ref inside the option resolves against the option's own $defs. - /conf/functions/truthy:
truthy fails on false, "", 0, and null, and passes on an empty array, an empty object, and a string. - /conf/functions/undefined:
undefined fails on a present property and passes on an absent one. - /conf/functions/unreferenced-reusable-object:
unreferencedReusableObject reports a member of the container that nothing references. - /conf/functions/xor:
xor fails unless exactly one of properties is present. - /conf/functions/xor-null: A key whose value is null counts as present, so
{a: null, b: 1} has two of the properties.
- /conf/linter/accept-valid: A valid ruleset is loaded and linting produces its results.
- /conf/linter/reject-invalid: Given an invalid ruleset, the linter rejects it and produces no results.
- /conf/linter/walkthrough: The running example of the Linting chapter: a ruleset that extends a base, enables a rule by shorthand, declares an alias, and overrides a severity for legacy documents, linting one legacy document.
- /conf/overrides/aliases-existing-rule: An alias an override declares does not change a rule the ruleset defines: the rule keeps the ruleset's alias and only its severity changes.
- /conf/overrides/aliases-new-rule: A rule an override defines resolves aliases against the override's, which take precedence over the ruleset's alias of the same name.
- /conf/overrides/aliases-outside-globs: Outside the override's globs its aliases have no effect, and the rule keeps its default severity.
- /conf/overrides/extends: An override's
extends adds rules for the documents it matches. - /conf/overrides/extends-with-rules: An applying override with
extends and rules adds to the rulesets the ruleset extends: a, b, and r all run. - /conf/overrides/extends-without-rules: An applying override with
extends and no rules replaces the rulesets the ruleset extends: b and the ruleset's own r run, a does not. - /conf/overrides/file-scoped-empty: A file-scoped override with neither
extends nor rules is invalid. - /conf/overrides/file-scoped-valid: A file-scoped override with
rules, extends, formats, parserOptions, and aliases is valid. - /conf/overrides/mixed-globs: An override whose
files mix a pointer glob and a plain glob is file-scoped, so it can define rules with shorthands and is valid. - /conf/overrides/order: Of two overrides that both match, the later one wins.
- /conf/overrides/pointer-scope: A pointer-scoped override silences the rule under its pointer only.
- /conf/overrides/pointer-scope-at: A pointer that names the result's own location silences it.
- /conf/overrides/pointer-scoped-extends: A pointer-scoped override with
extends is invalid. - /conf/overrides/pointer-scoped-rule-object: A pointer-scoped override that defines a rule object is invalid.
- /conf/overrides/pointer-scoped-valid: A pointer-scoped override whose
rules are severities only is valid. - /conf/overrides/redefined-rule-alias-applied: An override that redefines a rule with an alias only the override declares makes a linter reject the ruleset for a document it applies to.
- /conf/overrides/redefined-rule-alias-declared: An override that redefines a rule with an alias the ruleset declares is loaded, and the redefined rule runs.
- /conf/overrides/scope-match: A document inside the override's globs gets the override's severity.
- /conf/overrides/scope-no-match: A document outside the override's globs keeps the base severity.
- /conf/overrides/scope-outside-ruleset-directory: The same glob does not match a document in a
legacy/ directory that is not next to the ruleset, whatever the working directory. - /conf/overrides/scope-ruleset-directory: A glob is matched against the document's path relative to the ruleset file's directory, so
legacy/** matches a document in legacy/ next to the ruleset. - /conf/overrides/shape-empty: An empty
overrides array is invalid. - /conf/overrides/shape-no-files: An override without
files is invalid. - /conf/overrides/shape-valid: An override with a non-empty
files array is valid. - /conf/overrides/unknown-property-applied: An override with a property the Ruleset Object does not have makes a linter reject the ruleset for a document it applies to.
- /conf/overrides/unknown-property-not-applied: The same override, applying to no document being linted, does not stop the ruleset from loading.
- /conf/then/apply-each: Two invocations that both fail on the same node produce two results.
- /conf/then/apply-each-problem: One invocation whose function returns two problems produces two results.
- /conf/then/field: With
field, the function sees the named property of the matched node. - /conf/then/field-jsonpath: A
field that is a JSONPath expression applies the function to every value it selects. - /conf/then/field-key: With
field: "@key" on a matched object, the function sees each of its property keys; the key that does not match the pattern is reported. - /conf/then/field-missing: With
field naming a property the node lacks, the function sees no value, so defined fails. - /conf/then/field-path: A
field that is a path of property names reaches a nested value. - /conf/then/function-core: A rule naming a core function is valid.
- /conf/then/function-missing: An invocation without
function is invalid. - /conf/then/function-options: The
max option reaches the length function. - /conf/then/function-unknown: A rule naming a function that is neither core nor declared is invalid.
- /conf/then/invocation-form-valid: An invocation with
function, field, and functionOptions of the right types is valid. - /conf/then/options-not-object: An invocation whose
functionOptions is a string is invalid. - /conf/then/options-on-no-option-function:
truthy with options is invalid, because it takes none. - /conf/then/options-required-missing:
length with empty options is invalid, because it needs min or max. - /conf/then/options-unknown-value:
casing with type: lower, which is not a case the function knows, is invalid. - /conf/then/options-valid: Core functions with options that match their tables are valid.
- /conf/then/shape-empty-array: A rule with
then: [] is valid. - /conf/then/shape-string: A rule whose
then is a string is invalid. - /conf/then/shape-valid:
then as a single invocation and as an array of them are both valid.