Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
58 lines (38 sloc) 2.39 KB

Schema Registry Sink over HTTP

This library provides a sink class to the schema registry over the HTTP connection.

NuGet Package Status

Package Download Version


IHttpSchemaSink and HttpSchemaSink

As an extension of ISchemaSink and SchemaSink respectively, both IHttpSchemaSink and HttpSchemaSink declare extra properties:

  • Encoding: Gets or sets the file encoding. Default is Encoding.UTF8.
  • WithHttpClient(HttpClient httpClient): Adds the HttpClient instance.

It also has two overriding methods, GetSchemaAsync(string path) and SetSchemaAsync(string schema, string path).

NOTE: The path parameter value MAY be fully qualified URL. However, if it is the fully qualified URL path, both methods rip off the base location from it. Make sure that, when the fully qualified URL is used, it MUST contain the same base URL as the sink recognises. Otherwise it will throw an exception.

var location = "";
var httpClient = new HttpClient();

var sink = new HttpSchemaSink()

var schema = "{" +
             "  \"type\": \"object\"," +
             "  \"properties\": {" +
             "    \"hello\": {" +
             "      \"type\": \"string\"" +
             "    }" +
             "  }" +

var path1 = "v1/schema.json";

var sinked1 = await sink.SetSchemaAsync(schema, path1)

var schema1 = await sink.GetSchemaAsync(path1)

var path2 = "";

var sinked2 = await sink.SetSchemaAsync(schema, path2)

var schema2 = await sink.GetSchemaAsync(path2)
You can’t perform that action at this time.