API Reference JSON
An api section turns a JSON description of a public C# API into browsable pages for namespaces, types, and members. Generate the file with CSharpApiExtractor or create the same structure in another tool, then load it into the API Reference section editor.
Top-level structure
The root object is keyed by namespace. Each namespace value is an object keyed by the relative type name. Use an empty string as the namespace key for types in the global namespace. Nested type names use dot notation, for example Client.Options.
{
"Acme.Sdk": {
"Client": {
"name": "Client",
"summary": "Calls the Acme service.",
"declaration": "public sealed class Client",
"type": 0,
"access": "public",
"isStatic": 0,
"isAbstract": 0,
"baseClass": "Object",
"interfaces": ["IDisposable"],
"members": []
}
}
}
The namespace and type objects are required. Invalid namespace or type values are skipped. A type should have a non-empty key or name; declaration is used to build its stable viewer route.
Type fields
name— type name relative to the namespace. If omitted, the object key is used.summary— documentation text, normally extracted from the XMLsummary.declaration— complete C# declaration displayed in the reference.type— type kind:0class,1interface,2struct,3enum, or4record. The stringsclass,interface,struct,enum, andrecordare also accepted. The default is class.access— access modifier; the default ispublic.isStatic,isAbstract— boolean-like flags. JSON booleans and0/1are accepted.baseClass— base class name.interfaces— array of implemented interface names.members— array of member objects.
Member fields
Every member requires a non-empty name and a numeric type greater than zero. Unsupported or incomplete members are skipped.
type—1field or event,2property,3constructor, method, or operator,4delegate,5indexer,6enum value. A type-1 member whosevalueTypeisAction,Func, orPredicateis shown as an event.name,declaration,summary, andaccessdescribe the member and its displayed signature.valueTypecontains the field, event, property, indexer, or return type.isStatic,isVirtual,isAbstract,isGeneric,hasGet, andhasSetare boolean-like flags.parametersis an array of parameter objects.
For type: 3, the name .ctor creates a constructor. A static name beginning with op_ creates an operator; other values create methods.
Member example
The following object describes a public asynchronous method. Place it inside the type's members array.
{
"name": "GetAsync",
"declaration": "public Task<Item> GetAsync(string id, CancellationToken cancellationToken = default)",
"type": 3,
"summary": "Gets an item by ID.",
"access": "public",
"isStatic": false,
"isGeneric": false,
"isVirtual": false,
"isAbstract": false,
"valueType": "Task<Item>",
"parameters": [
{
"name": "id",
"type": "string",
"summary": "Item identifier."
},
{
"name": "cancellationToken",
"type": "CancellationToken",
"summary": "Cancels the operation.",
"isOptional": true,
"defaultValue": "default"
}
]
}Parameter fields
nameandtypeidentify the parameter.summarycontains its documentation.refKindstores modifiers such asref,out, orin.isOptionalmarks an optional parameter;defaultValuestores the displayed default value.
Complete example
{
"Acme.Sdk": {
"Client": {
"name": "Client",
"summary": "Calls the Acme service.",
"declaration": "public sealed class Client : IDisposable",
"type": 0,
"baseClass": "Object",
"interfaces": ["IDisposable"],
"members": [
{
"name": ".ctor",
"declaration": "public Client(string endpoint)",
"type": 3,
"summary": "Creates a client.",
"parameters": [
{
"name": "endpoint",
"type": "string",
"summary": "Service URL."
}
]
},
{
"name": "GetAsync",
"declaration": "public Task<Item> GetAsync(string id, CancellationToken cancellationToken = default)",
"type": 3,
"summary": "Gets an item.",
"valueType": "Task<Item>",
"parameters": [
{ "name": "id", "type": "string", "summary": "Item identifier." },
{
"name": "cancellationToken",
"type": "CancellationToken",
"isOptional": 1,
"defaultValue": "default"
}
]
}
]
}
}
}Validation and routes
The input must be valid JSON with an object at the root. One File Docs normalizes and sorts namespaces, types, and member groups. Viewer IDs are generated from declarations, so keep declarations stable and make overloaded member declarations distinct. After loading the file, review the namespace, type, and member counts shown by the editor before saving or exporting.