TTMSMCPJSONSchemaGenerator.FromTypeInfo Method
Generates a schema from type information obtained at run time, using the default settings. It is the low-level entry point the other overloads resolve to, and the one to use when the type is only known through its type information.
API unit family: TMS.MCP.JSONSchema
Declaring type: TTMSMCPJSONSchemaGenerator
Overloads
Overload 1
Generates a schema from type information obtained at run time, using the default settings. It is the low-level entry point the other overloads resolve to, and the one to use when the type is only known through its type information.
class function FromTypeInfo(ATypeInfo: PTypeInfo): TJSONObject; overload;
Parameters
| Name | Description |
|---|---|
ATypeInfo |
Type information of the class or record to reflect. It must not be nil. |
Returns
A newly created schema object owned by the caller.
Exceptions
| Exception | Description |
|---|---|
EArgumentException |
Raised when the type information is nil. |
Overload 2
Generates a schema from type information obtained at run time, using the given settings.
class function FromTypeInfo(ATypeInfo: PTypeInfo; const AOptions: TTMSMCPJSONSchemaOptions): TJSONObject; overload;
Parameters
| Name | Description |
|---|---|
ATypeInfo |
Type information of the class or record to reflect. It must not be nil. |
AOptions |
Settings controlling which members are reflected and how the root object is emitted. |
Returns
A newly created schema object owned by the caller.
Exceptions
| Exception | Description |
|---|---|
EArgumentException |
Raised when the type information is nil. |