Skip to content

Commit

Permalink
fix: editorial fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Hudlow <[email protected]>
  • Loading branch information
hudlow committed Dec 23, 2024
1 parent fe3a0e9 commit d839ac9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions docs/openapi-ruleset-utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ references.

- **`schema`** `<object>`: simple or composite OpenAPI 3.x schema object
- **`path`** `<Array>`: path array for the provided schema
- **`validate`** `<function>`: a `(schema, path, logicalPath) => errors` function to validate a simple schema
- **`validate`** `<function>`: a `(schema, path) => errors` function to validate a simple schema
- **`includeSelf`** `<boolean>`: validate the provided schema in addition to its composed schemas (defaults to `true`)
- **`includeNot`** `<boolean>`: validate schemas composed with `not` (defaults to `true`)

Expand All @@ -387,9 +387,9 @@ Nested schemas included via `allOf`, `oneOf`, and `anyOf` are validated, but com
are not themselves validated. By default, nested schemas included via `not` are not validated.

The provided validate function is called with three arguments:
- `composedSchema`: the composed schema
- `path`: the array of path segments to locate the composed schema within the resolved document
- `logicalPath`: the array of path segments to locate an instance of `composedSchema` within an
- `nestedSchema`: the nested schema
- `path`: the array of path segments to locate the nested schema within the resolved document
- `logicalPath`: the array of path segments to locate an instance of `nestedSchema` within an
instance of `schema` (the schema for which `validateNestedSchemas()` was originally called.)
Within the logical path, an arbitrary array item is represented by `[]` and an arbitrary
dictionary property is represented by `*`.
Expand Down
4 changes: 2 additions & 2 deletions packages/utilities/src/utils/validate-composed-schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const SchemaPath = require('./schema-path');
* references.
* @param {object} schema simple or composite OpenAPI 3.x schema object
* @param {Array} path path array for the provided schema
* @param {Function} validate a `(schema, path, logicalPath) => errors` function to validate a simple schema
* @param {Function} validate a `(schema, path) => errors` function to validate a simple schema
* @param {boolean} includeSelf validate the provided schema in addition to its composed schemas (defaults to `true`)
* @param {boolean} includeNot validate schemas composed with `not` (defaults to `true`)
* @returns {Array} validation errors
Expand All @@ -59,7 +59,7 @@ function validateComposedSchemas(

if (includeSelf) {
// We intentionally do not use `path.logical` here because the documented external contract
// for validateComposedSchemas() is that the validate function is called with two arguments.
// for `validateComposedSchemas()` is that the validate function is called with two arguments.
// Tracking the logical path is only useful when `validateComposedSchemas()` is embedded in
// another utility that can pass it an instance of `SchemaPath` (which is not exported).
errors.push(...validate(schema, [...path], p?.logical));
Expand Down
6 changes: 3 additions & 3 deletions packages/utilities/src/utils/validate-nested-schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ const SchemaPath = require('./schema-path');
* are not themselves validated. By default, nested schemas included via `not` are not validated.
*
* The provided validate function is called with three arguments:
* - `composedSchema`: the composed schema
* - `path`: the array of path segments to locate the composed schema within the resolved document
* - `logicalPath`: the array of path segments to locate an instance of `composedSchema` within an
* - `nestedSchema`: the nested schema
* - `path`: the array of path segments to locate the nested schema within the resolved document
* - `logicalPath`: the array of path segments to locate an instance of `nestedSchema` within an
* instance of `schema` (the schema for which `validateNestedSchemas()` was originally called.)
* Within the logical path, an arbitrary array item is represented by `[]` and an arbitrary
* dictionary property is represented by `*`.
Expand Down

0 comments on commit d839ac9

Please sign in to comment.