Skip to content

[FEATURE] Demonstrate custom validators in HelloWorld Extension #350

@dbwiddis

Description

@dbwiddis

Is your feature request related to a problem?

The Validator class used for the validator field in Setting is not Writeable.

What solution would you like?

Create a new class in the Hello World Extension package similar to ExampleCustomSettingsConfig in the OpenSearch example-plugins:custom-settings module. Demonstrate a validated string setting (see example in the custom setting plugin) that does not allow the word "forbidden".

In the Setting class, add a RegexValidator class implementing Validator<T> and Writeable that throws an exception if the String (regular expression) matches the input value.

  • make the word that's forbidden a regex in a String field you set in the constructor, and that gets written.

Make sure the getSettings() extension point sends this setting to OpenSearch.

Update WriteableSetting to write the validator.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions