confluentinc / confluent-kafka-dotnet

Confluent's Apache Kafka .NET client
https://github.com/confluentinc/confluent-kafka-dotnet/wiki
Apache License 2.0
88 stars 868 forks source link

feat-req: JSON schema generator/validation abstraction #1382

Open skwasjer opened 4 years ago

skwasjer commented 4 years ago

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:

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.

mhowlett commented 4 years ago

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.