Skip to content

Get Schema

This example assumes using Weaviate; is in scope and apiKey contains your Weaviate API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
var client = Client;

Schema schema = await client.Schema.SchemaDumpAsync();

foreach (var cls in schema.Classes ?? [])
{
    Console.WriteLine($"Class: {cls.Class1}");
    Console.WriteLine($"  Description: {cls.Description}");

    foreach (var prop in cls.Properties ?? [])
    {
        Console.WriteLine($"  Property: {prop.Name} ({string.Join(", ", prop.DataType ?? [])})");
    }

    Console.WriteLine();
}