In relation to my previous PR #1373 I would argue perhaps an improvement would be to provide an abstraction for JSON schema generation and validation, so as to allow other implementations to be used. I am thinking of use cases where you may want to:
Use schemas from other sources (ie. disk, database, or otherwise) as opposed to in-mem generation, loaded through f.ex. JsonSchema.FromJsonAsync(..).
F.ex. in schema driven / infra as code driven development, we have started of with the schemas, deploy them using CI/CD to schema registry (we do not use automatic schema registration), but if we then use slightly different tooling to generate C# classes or even handcraft them, this is prone failing to retrieve (correct) the schema id if NJsonSchema does not produce the correct 'schema text'. As such having the option to get explicit control over the JsonSchema used for validation would be helpful.
Hope it makes some sense, would appreciate your opinion and I will gladly offer my help if so desired.
yes, certainly open to all that. what's there is an initial implementation.
hopefully the current implementation is not going to be too problematic to extend.
Description
In relation to my previous PR #1373 I would argue perhaps an improvement would be to provide an abstraction for JSON schema generation and validation, so as to allow other implementations to be used. I am thinking of use cases where you may want to:
JsonSchema.FromJsonAsync(..)
.F.ex. in schema driven / infra as code driven development, we have started of with the schemas, deploy them using CI/CD to schema registry (we do not use automatic schema registration), but if we then use slightly different tooling to generate C# classes or even handcraft them, this is prone failing to retrieve (correct) the schema id if NJsonSchema does not produce the correct 'schema text'. As such having the option to get explicit control over the
JsonSchema
used for validation would be helpful.Hope it makes some sense, would appreciate your opinion and I will gladly offer my help if so desired.