var schema = new SchemaBuilder() .AddRequiredString("name") .AddOptionalInt("age") .Build(); var dict = schema.ToDictionary();
var schema = new JSchema { Type = JSchemaType.Object, Properties = { { "name", new JSchema { Type = JSchemaType.String } }, { "age", new JSchema { Type = JSchemaType.Integer } } }, Required = { "name" } }; var dict = SchemaShape.ToDictionary(schema);In this example, we use the JSchema object from the Json.NET package library to define the schema. Then, we call the ToDictionary method from the SchemaShape package library to convert the JSchema object to a dictionary object. This way, we can easily manipulate and validate the JSON data based on the defined schema.