[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/management-protocol](https://jsprismarine.dev/api/@jsprismarine/management-protocol/index.md) / schemaCheck

# schemaCheck

## Type Aliases

### Components

> **Components** = `Readonly`\<`Record`\<`string`, `unknown`\>\>

Defined in: [schemaCheck.ts:12](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/management-protocol/src/schemaCheck.ts#L12)

The component schemas a `$ref` points into, by component name.

## Functions

### schemaMismatch()

> **schemaMismatch**(`schema`, `value`, `components`, `path?`): `string` \| `undefined`

Defined in: [schemaCheck.ts:44](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/management-protocol/src/schemaCheck.ts#L44)

Finds the first place a value breaks a schema.

#### Parameters

##### schema

`unknown`

A schema of the document, such as a method parameter's.

##### value

`unknown`

The value to check.

##### components

[`Components`](#components)

The document's component schemas.

##### path?

`string` = `'value'`

Where the value is, for the message.

#### Returns

`string` \| `undefined`

What is wrong and where, or undefined when the value matches.
