Skip to main content
All docs

JsonDataSource.LoadSchema(Type) Method

Creates the data source schema from the provided type.

Namespace: DevExpress.DataAccess.Json

Assembly: DevExpress.DataAccess.v22.2.dll

NuGet Package: DevExpress.DataAccess


public JsonSchemaNode LoadSchema(
    Type type


Name Type Description
type Type

The type used to create the schema.


Type Description

The created data source schema.


Use this method to specify a JSON data source schema without the need to read data from the endpoint. This method creates a data source field for each public property from the specified type parameter. Private, protected, and internal properties are ignored. A property’s type is used to specify the field type.


Members of the specified type should not be of the same type (or an inherited type) to avoid the stack overflow exception.


The code sample below creates a new JSON data source and uses the JsonDataObject and Customer types to specify the data source schema.

Data Source Schema

using DevExpress.DataAccess.Json;
// ...
public class JsonDataObject
    public Customer[] Customers { get; set; }
public class Customer
    // A public property shown in the data source field list.
    public string CompanyName { get; set; }
    // A private property not shown in the data source field list.
    private string ContactName { get; set; }
JsonDataSource dataSource = new JsonDataSource();
dataSource.JsonSource = new UriJsonSource()
    Uri = new Uri(@"")
// Create the data source schema from the JsonDataObject type.
dataSource.Schema = dataSource.LoadSchema(typeof(JsonDataObject));
See Also