Skip to content
v2.275.0

JsonSchemaValidator Class ​

Defines a JSON Schema validator.

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()
python
JsonSchemaValidator()
java
new JsonSchemaValidator()
csharp
new JsonSchemaValidator()
go
NewJsonSchemaValidator()

Properties ​

contentstringcontentstrcontentStringContentstringContent*string#
The content of the validator.

Methods ​

fromFile(inputPath: string): JsonSchemaValidator // chainable@staticmethod def from_file(input_path: str) -> JsonSchemaValidatorpublic static JsonSchemaValidator fromFile(String inputPath)public static JsonSchemaValidator FromFile(string inputPath)func FromFile(InputPath *string) JsonSchemaValidatorstatic#
Defines a JSON Schema validator from a file.
1 parameter

Parameters

  • inputPathinput_pathinputPathinputPathInputPath — The path to the file that defines the validator.
fromInline(code: string): JsonSchemaValidator // chainable@staticmethod def from_inline(code: str) -> JsonSchemaValidatorpublic static JsonSchemaValidator fromInline(String code)public static JsonSchemaValidator FromInline(string code)func FromInline(Code *string) JsonSchemaValidatorstatic#
Defines a JSON Schema validator from inline code.
1 parameter

Parameters

  • codecodecodecodeCode — The inline code that defines the validator.