public void RetrieveSchema() { var client = new SchemaRegistryClient(TestEnvironment.SchemaRegistryUri, TestEnvironment.Credential); #region Snippet:SchemaRegistryRetrieveSchema string schemaId = "<schema_id>"; Response <SchemaProperties> schemaProperties = client.GetSchema(schemaId); string schemaContent = schemaProperties.Value.Content; #endregion }
public void RetrieveSchema() { var schemaId = _schemaProperties.Id; #region Snippet:SchemaRegistryRetrieveSchema SchemaRegistrySchema schema = client.GetSchema(schemaId); string content = schema.Content; #endregion Assert.AreEqual(Regex.Replace(_content, @"\s+", string.Empty), content); }
public void RetrieveSchema() { var schemaId = _schemaProperties.Id; #region Snippet:SchemaRegistryRetrieveSchema SchemaRegistrySchema schema = client.GetSchema(schemaId); string definition = schema.Definition; #endregion Assert.AreEqual(Regex.Replace(_definition, @"\s+", string.Empty), definition); }
public void RetrieveSchema() { var schemaId = _schemaProperties.Id; #region Snippet:SchemaRegistryRetrieveSchema Response <SchemaProperties> schemaProperties = client.GetSchema(schemaId); string schemaContent = schemaProperties.Value.Content; #endregion Assert.AreEqual(Regex.Replace(_schemaProperties.Content, @"\s+", string.Empty), schemaContent); }
private Schema GetSchemaById(string schemaId, CancellationToken cancellationToken) { if (_cachedSchemas.TryGetValue(schemaId, out var cachedSchema)) { return(cachedSchema); } var schemaContent = _client.GetSchema(schemaId, cancellationToken).Value.Content; var schema = Schema.Parse(schemaContent); _cachedSchemas.Add(schemaId, schema); return(schema); }
private async Task <Schema> GetSchemaByIdAsync(string schemaId, bool async, CancellationToken cancellationToken) { if (_cachedSchemas.TryGetValue(schemaId, out Schema cachedSchema)) { return(cachedSchema); } string schemaContent; if (async) { schemaContent = (await _client.GetSchemaAsync(schemaId, cancellationToken).ConfigureAwait(false)).Content; } else { schemaContent = _client.GetSchema(schemaId, cancellationToken).Content; } var schema = Schema.Parse(schemaContent); _cachedSchemas.Add(schemaId, schema); return(schema); }