# JsonSchemaValidator

Defines a JSON Schema validator.

Extends: JsonSchemaValidator
Implements: IValidator

- Source: [`aws-appconfig/lib/configuration.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-appconfig/lib/configuration.ts#L806)
- Type last changed: v2.130.0 · 23 Feb 2024

## Example

```ts
declare const application: appconfig.Application;
declare const fn: lambda.Function;

new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
  application,
  content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'),
  validators: [
    appconfig.JsonSchemaValidator.fromFile('schema.json'),
    appconfig.LambdaValidator.fromFunction(fn),
  ],
});
```

## Initializer

```ts
new JsonSchemaValidator()
```

## Properties

- `content`: string — The content of the validator.

- `type`: [ValidatorType](/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.ValidatorType.html) — The type of validator.

## Methods

- `fromFile(inputPath: string): JsonSchemaValidator // chainable` (static) — Defines a JSON Schema validator from a file.

  **Parameters**

  - `inputPath` — The path to the file that defines the validator.

- `fromInline(code: string): JsonSchemaValidator // chainable` (static) — Defines a JSON Schema validator from inline code.

  **Parameters**

  - `code` — The inline code that defines the validator.
