Skip to content

DARTCLIENT

Control Dart client code generation for individual endpoints using custom parameter annotations. Available since version 3.20.0.

Requires Configuration

Dart client generation must be enabled in the Dart Code Generation configuration (DartClientCodeGen.Enabled = true).

Syntax

code
@dartclient = <true|false>
@dartclient_module = <module_name>
@dartclient_status_code = <true|false>
@dartclient_events = <true|false>
@dartclient_parse_url = <true|false>
@dartclient_parse_request = <true|false>
@dartclient_export_url = <true|false>
@dartclient_url_only = <true|false>

Parameters

ParameterDescription
dartclientSet to off/false/disabled to exclude this endpoint from the generated Dart client.
dartclient_moduleSets a different module name for the generated Dart client file. Endpoints with the same module name are grouped into the same file. Falls back to tsclient_module, so SQL-file directory grouping applies to both generators.
dartclient_status_codeEnable or disable the ApiResult<T> status wrapper in the return value.
dartclient_eventsEnable or disable the SSE event-source parameters for endpoints with SSE events enabled.
dartclient_parse_urlEnable or disable the parseUrl named parameter in the generated function.
dartclient_parse_requestEnable or disable the parseRequest named parameter in the generated function.
dartclient_export_urlWhen true, emits a {name}Url() URL-builder function for this endpoint regardless of the global ExportUrls setting.
dartclient_url_onlyWhen true, emits only the URL-builder function for this endpoint (no fetch function).

Examples

Exclude an endpoint from the Dart client:

sql
sql
comment on function internal_maintenance() is '
HTTP POST
@dartclient = off
';

Group endpoints into one module file with the status wrapper:

sql
sql
comment on function get_orders(_customer text) is '
HTTP GET
@dartclient_module = orders
@dartclient_status_code = true
';

Comments