Skip to content

Feature/validation extension - #116

Open
khalsz wants to merge 5 commits into
iterorganization:developfrom
khalsz:feature/validation-extension
Open

Feature/validation extension#116
khalsz wants to merge 5 commits into
iterorganization:developfrom
khalsz:feature/validation-extension

Conversation

@khalsz

@khalsz khalsz commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR introduces support for loading an extended custom validator class from the server configuration. This allows users to extend SimDB's validation framework while remaining compatible with upstream releases, without needing to modify SimDB directly.

With this feature, users can install their own validation package into the application's virtual environment and specify the validator class to use in the server configuration.

Example configuration:

validation: custom_validator: myvalidator.validators.MyValidator

How it works

At startup, SimDB will:

Read the configured validator class path.
Dynamically import the specified module.
Load the configured validator class.
Verify that it inherits from CustomValidator.
Use the configured validator class throughout the validation pipeline instead of the default CustomValidator.
If no custom validator is configured, SimDB continues to use the built-in CustomValidator, preserving the existing behaviour.

Benefits

Enables project-specific validation rules without modifying SimDB.
Makes the validation framework extensible while remaining compatible with upstream releases.
Maintains backward compatibility when no custom validator is configured.
Provides a clean extension point for custom validation implementations.

Example use case

A project can create its own package containing a validator implementation:

from simdb.validation.validator import CustomValidator class MyValidator(CustomValidator):
...

After installing the package into the same virtual environment as SimDB, the project only needs to configure:

[validation]: custom_validator: myvalidator.validators.MyValidator

No changes to the SimDB source code are required.

@khalsz
khalsz force-pushed the feature/validation-extension branch from 0f05aa1 to 48a18e6 Compare August 7, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant