Skip to main content

Validation rules

The registry goal enforces the following rules on every build. Violations fail the build with a descriptive error message.

Naming and structure

RuleDetails
System directory must be lowercasejmeJME
System directory name must match the system field in the descriptorCase-insensitive comparison.
Index type directory name must equal the descriptor filename (lowercased, without .json)jmedecreedocument/JmeDecreeDocument.json
Index type name (originType) must start with the system name in title caseSystem JME → origin type must start with Jme.
Only descriptor and versioned mapping files may exist in an index type directoryNo extra files, READMEs, or subdirectories allowed.

Schema validation

RuleDetails
Every descriptor file is validated against IndexTypeDescriptor.schema.jsonMissing required fields or wrong types fail the build.
Every mapping file is validated against IndexTypeMappingDescriptor.schema.jsonIncorrect search_item or origin sections fail the build.
All field names in data.properties (recursively) must be snake_casePattern: [a-z][a-z0-9]*(_[a-z0-9]+)*. camelCase names fail the build.
dynamic: false must be setRequired in all mapping files.

The snake_case rule is strictly enforced because the index writer service serialises documents using PropertyNamingStrategies.SNAKE_CASE. A camelCase field in the mapping would never match the data actually written to OpenSearch.

Immutability (compared to trunk branch)

The plugin clones the configured gitUrl at trunkBranchName and compares the current working tree against it. Three immutability rules apply:

RuleDetails
No system directory may be deletedRemoving a system fails the build.
No index type directory may be deletedRemoving an index type fails the build.
No existing mapping file may be changedDetected by CRC32 checksum comparison.

To bypass trunk comparison during local development, set gitUrl to empty:

mvn verify -Dindextype.git.url=

Minor version backward compatibility

Within the same major version, each successive minor version may only add properties to the data section — never remove them. This is checked for every adjacent minor version pair (e.g. v1.0→v1.1, v1.1→v1.2):

ChangeAllowed in minor versionRequires major version bump
Add a new field to dataYesNo
Remove a field from dataNoYes
Rename a field in dataNoYes
Change a field typeNoYes

Role changes

The roles field in the descriptor may only be changed when at least one new mapping version (major or minor) is introduced at the same time. Changing roles without adding a new version fails the build.