Skip to content

feat: add JSON Schema validation for Flagd provider when in-process mode is used #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kylejuliandev
Copy link
Contributor

This PR

  • Adds NJsonSchema to validate Flagd configurations when in-process mode is used. Schemas used are: Flags and targeting

Related Issues

Fixes #226

Notes

Not yet quite finished. Needs some unit tests. Initial testing locally seems to suggest it is working as expected

image

I'm not sure how keen I am on extending FlagdConfig.cs with ILogger. An alternative approach might be to make it more first class by tweaking the constructor of the FlagdProvider.cs

public FlagdProvider(FlagdConfig config, ILogger logger)
{
    // ... other config setup

    if (logger == null)
    {
        logger = NullLogger.Instance;
    }
    _logger = logger
}

Follow-up Tasks

How to test

* Fix unit tests failing due to change in constructor
* Add initial documentation to README
* Add ILogger to provider config

Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
@kylejuliandev kylejuliandev marked this pull request as ready for review April 28, 2025 18:17
@kylejuliandev kylejuliandev requested review from a team as code owners April 28, 2025 18:17
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.

[flagd] Add targeting validation and log warning
3 participants