/** @mainpage Qore JSON Module
@tableofcontents
@section jsonintro Introduction
The json module allows for easy serialization and deserialization between JSON strings and %Qore data structures. The module also provides functions for @ref JSONRPC support as well as a @ref Qore::Json::JsonRpcClient "JsonRpcClient" class for easier integration with JavaScript clients.
This module is released under a choice of two licenses:
- LGPL 2.1
- MIT (see COPYING.MIT in the source distribution for more information)
.
The module is tagged as such in the module's header (meaning it can be loaded unconditionally regardless of how the %Qore library was initialized).
To use the module in a %Qore script, use the \c %%requires directive as follows:
@code %requires json @endcode
Also included with the binary json module:
- JsonRpcHandler user module
@note JSON functionality was included in the main %Qore shared library until version 0.8.1, at which time the code was removed to make this module.
@section jsonserialization Automatic JSON Serialization and Deserialization
JSON Serialization
@htmlonly @endhtmlonly
Function Name |
Description |
@ref make_jsonrpc11_error() |
Creates a JSON-RPC 1.1 error response string from the parameters passed with optional verbose whitespace formatting for easier human readability |
@ref make_jsonrpc_error() |
a generic JSON-RPC error response string from the parameters passed with optional verbose whitespace formatting for easier human readability |
@ref make_jsonrpc_request() |
Creates a JSON-RPC request string from the parameters passed with optional verbose whitespace formatting for easier human readability |
@ref make_jsonrpc_response() |
Creates a JSON-RPC response string from the parameters passed with optional verbose whitespace formatting for easier human readability |
Deprecated Function Name |
New Function Name |
@ref makeFormattedJSONRPC11ErrorString() |
@ref make_jsonrpc11_error() |
@ref makeFormattedJSONRPCErrorString() |
@ref make_jsonrpc_error() |
@ref makeFormattedJSONRPCRequestString() |
@ref make_jsonrpc_request() |
@ref makeFormattedJSONRPCResponseString() |
@ref make_jsonrpc_response() |
@ref makeJSONRPC11ErrorString() |
@ref make_jsonrpc11_error() |
@ref makeJSONRPCErrorString() |
@ref make_jsonrpc_error() |
@ref makeJSONRPCRequestString() |
@ref make_jsonrpc_request() |
@ref makeJSONRPCResponseString() |
@ref make_jsonrpc_response() |
@section codetags Function and Method Tags
@subsection NOOP NOOP
Code with this flag makes no calculations, but rather returns a constant value. This flag is given to function and method variants that return a default value depending on the type of argument(s). When variants with this flag are resolved at parse time, a \c "call-with-type-errors" warning is raised (assuming this warning is enabled), unless \c PO_REQUIRE_TYPES or \c PO_STRICT_ARGS is set. If \c PO_REQUIRE_TYPES or \c PO_STRICT_ARGS is set, then these variants are inaccessible at parse time; resolving to a variant with this flag set at parse time causes an exception to be thrown.
These variants are included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
This tag is equal to @ref RUNTIME_NOOP, except no runtime effect is caused by resolving a function or method tagged with \c NOOP at runtime; this tag only affects parse time resolution.
@subsection RUNTIME_NOOP RUNTIME_NOOP
Code with this flag makes no calculations, but rather returns a constant value. This flag is given to function and method variants that return a default value depending on the type of argument(s). When variants with this flag are resolved at parse time, a \c "call-with-type-errors" warning is raised (assuming this warning is enabled), unless \c PO_REQUIRE_TYPES or \c PO_STRICT_ARGS is set. If \c PO_REQUIRE_TYPES or \c PO_STRICT_ARGS is set, then these variants are inaccessible; resolving to a variant with this flag set at parse time or run time causes an exception to be thrown.
These variants are included for backwards-compatibility with qore prior to version 0.8.0 for functions that would ignore type errors in arguments.
This tag is equal to @ref NOOP, except that \c RUNTIME_NOOP is also enforced at runtime.
@subsection RET_VALUE_ONLY RET_VALUE_ONLY
This flag indicates that the function or method has no side effects; it only returns a value, for example.
This tag is identical to @ref CONSTANT except that functions or methods tagged with \c RET_VALUE_ONLY could throw exceptions.
@subsection CONSTANT CONSTANT
This flag indicates that the function or method has no side effects and does not throw any exceptions.
This tag is identical to @ref RET_VALUE_ONLY except that functions or methods tagged with \c CONSTANT do not throw exceptions.
@subsection DEPRECATED DEPRECATED
Code with this flag is deprecated and may be removed in a future version of this module; if a variant with this flag is resolved at parse time, a \c "deprecated" warning is raised (assuming this warning is enabled).
@section jsonreleasenotes Release Notes
@subsection v0_1_6 Version 1.6
- @ref parse_json() now ignores UTF-8 and Unicode BOMs at the start of passed JSON string (