Installation and Getting Started Guide

Installation and Getting Started Guide

Generating a JSON Schema Document

Generating a JSON Schema Document

The IDVE_ GetJSONSchema() function generates a JSON schema document for properties that the URI specifies. The IDVE_GetJSONSchema() function returns the data in a UTF-8-encoded string, whereas the IDVE_GetJSONSchemaW() function returns the data in a UTF-16-encoded string. The functions otherwise operate identically. You can call the functions without initializing the engine.

Generating the Schema Document in the UTF-8 Encoding

The following sample code shows the structure of the IDVE_GetJSONSchema() function:
IDVE_EXPORTCALL1 IDVE_StatusCode IDVE_EXPORTCALL2
IDVE_GetJSONSchema
( const char* const kpksURI, char* const kpsValueBuffer, const IDVE_U64 ku64ValueBufferSize, IDVE_U64* const kpu64SizeWritten, char* const kpsExtStatusMsg );
The following table shows the parameter definitions for the IDVE_GetJSONSchema() function:
Parameter
Operation
Comment
const char* const kpksURI
[in]
Pointer to the zero-terminated 7-bit ASCII URI, for example "
AV/v1/Jobs/###
". The value might not be NULL.
char* const kpsValueBuffer
[out]
Pointer to the output buffer that receives the UTF-8-encoded JSON value and the terminating zero. The value might not be NULL.
const IDVE_U64 ku64ValueBufferSize
[in]
The size of the output buffer in code units, including the terminating zero.
IDVE_U64* const kpu64SizeWritten
[out]
Pointer to an unsigned 64-bit integer value that receives the size of the output written in code units, excluding the terminating zero. The value can be NULL.
char* const kpsExtStatusMsg
[out]
Pointer to a buffer of size IDVE_EXT_STATUS_MSG_BUFFER_SIZE for an optional extended status message. The value can be NULL.

Generating the Schema Document in the UTF-16 Encoding

The following sample code shows the structure of the IDVE_GetJSONSchemaW() function:
IDVE_EXPORTCALL1 IDVE_StatusCode IDVE_EXPORTCALL2
IDVE_GetJSONSchemaW
( const char* const kpksURI, IDVE_WChar* const kpsValueBuffer, const IDVE_U64 ku64ValueBufferSize, IDVE_U64* const kpu64SizeWritten, char* const kpsExtStatusMsg );
The following table shows the parameter definitions of the IDVE_GetJSONSchemaW() function:
Parameter
Operation
Comment
const char* const kpksURI
[in]
Pointer to the zero-terminated 7-bit ASCII URI, for example "
AV/v1/Jobs/###
". The value might not be NULL.
IDVE_WChar* const kpsValueBuffer
[out]
Pointer to the output buffer that receives the UTF-16-encoded JSON value and the terminating zero. The value might not be NULL.
const IDVE_U64 ku64ValueBufferSize
[in]
The size of the output buffer in code units, including the terminating zero.
IDVE_U64* const kpu64SizeWritten
[out]
Pointer to an unsigned 64-bit integer value that receives the size of the output written in code units, excluding the terminating zero. The value can be NULL.
char* const kpsExtStatusMsg
[out]
Pointer to a buffer of size IDVE_EXT_STATUS_MSG_BUFFER_SIZE for an optional extended status message. The value can be NULL.

0 COMMENTS

We’d like to hear from you!