-
Notifications
You must be signed in to change notification settings - Fork 32
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
base: main
Are you sure you want to change the base?
feat: add JSON Schema validation for Flagd provider when in-process mode is used #373
Conversation
* 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>
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
Signed-off-by: Kyle Julian <38759683+kylejuliandev@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor comment in relation to the NJsonSchema version. The rest are minor nitpicks. Great job!
@@ -24,6 +24,7 @@ | |||
<!-- The generated files will be placed in ./obj/Debug/netstandard2.0/Protos --> | |||
<PackageReference Include="JsonLogic" Version="5.4.0" /> | |||
<PackageReference Include="murmurhash" Version="1.0.3" /> | |||
<PackageReference Include="NJsonSchema" Version="11.2.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will you get a lot of breaking changes if you lower to 11.0.0? Since we are publishing this dependency (NJsonSchema), we shouldn't enforce newest versions.
return; | ||
} | ||
|
||
#if NET5_0_OR_GREATER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not as part of this PR, but we should bump the target framework...
var jsonSchemaValidator = Substitute.For<IJsonSchemaValidator>(); | ||
|
||
var jsonEvaluator = new JsonEvaluator(fixture.Create<string>()); | ||
var jsonEvaluator = new JsonEvaluator(fixture.Create<string>(), jsonSchemaValidator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of copy-paste here. I think we should move into a ctor, and control the flow here if needs any change.
This PR
Related Issues
Fixes #226
Notes
Not yet quite finished. Needs some unit tests. Initial testing locally seems to suggest it is working as expected
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
Follow-up Tasks
How to test