Method Definitions
CK language 2 lets a type or an interface declare methods: named, versioned operations with typed parameters, a result, declared error codes, authorization and execution settings. Methods are the planned way to change attributes that must not be written generically (access: MethodOnly) and to replace ad-hoc REST endpoints.
Methods are callable. Besides being validated by the compiler, persisted, shown in the generated documentation and turned into generated C# contracts, each method is a typed GraphQL mutation of its type (Calling a method over GraphQL). The platform checks authorization and data permission, honours an optional idempotency key (calls without a key, and methods declared execution.idempotent: true, run on every call) and dispatches the call to the method's handler over one of three transports: a remote handler over the event hub (bus), an in-process handler in the asset repository, or a deployed pipeline (handler: pipeline). How to write a handler: Implementing method handlers and Pipeline method handlers; transactions, failures and retries: Method consistency model.
Not available yet:
- Asynchronous platform methods. A method declared
execution.mode: asyncreturns an operation handle over GraphQL, andruntime.operationsreads its state, progress and result (Asynchronous callers); service handlers can accept such calls. The first platform job that is also a method is the repository backup,System.Bot/TenantRepository.Dump-1(see Backup as an asynchronous method); restore and the archive export and import are not methods yet. Every job keeps its job endpoint. - Methods owned by the asset repository (
Tenant.*,Archive.*). The in-process transport is released, but no production method uses it yet. - REST endpoints of the services are not migrated to methods yet; they keep working as before.
Syntax
types:
- typeId: Device
# ...
methods:
- methodId: UpdateFirmware-1
kind: Instance # Instance (default) | Static
description: Installs a firmware version.
parameters:
- name: version
valueType: String
- name: signingKey
valueType: String
sensitive: true # never logged, never in audit or traces
result:
valueType: String
sensitive: true # optional, default false: the result value is a secret
errors:
- code: FIRMWARE_REJECTED
description: The device refused the image.
authorization:
roles: [ AssetManagement ] # any of these roles
dataAccess: Read # optional: Read | Write (default), see "Data access"
execution:
timeoutSeconds: 60 # 1..300, default 15
idempotent: false # default false
handler: service # service (default) | pipeline
mode: sync # sync (default) | async
| Key | Required | Description |
|---|---|---|
methodId | yes | PascalCase name with element version, e.g. ChangePassword-1. A changed signature is published as a new version (ChangePassword-2). |
kind | no | Instance (default, called on one entity) or Static. |
description | no | Free text. |
parameters | no | List of name (camelCase), valueType, valueCkRecordId / valueCkEnumId (for Record / Enum), isOptional, sensitive, description. |
result | no | valueType plus valueCkRecordId / valueCkEnumId, and sensitive (default false, see Sensitive results). Omit for methods without a result. |
errors | no | Declared business error codes: code (UPPER_SNAKE_CASE, no METHOD_ prefix — reserved for platform errors), description. |
authorization | no | roles (any of; names compare case-insensitively), allowSelf (the caller's user id equals the target entity's id; instance methods only), scopes (additional scopes, all required; octo_api is always required). Default-deny: a method without authorization, or with empty roles, can only be invoked by administrators (not by the owner). Role and scope names use letters, digits and _ - . : /, starting with a letter or digit (message 104). dataAccess (Read or Write, default Write; the data permission a caller needs on the target record, see Data access). |
execution | no | timeoutSeconds (1–300, default 15), idempotent (default false), handler (service (default) or pipeline, see Handler kind), mode (sync (default) or async, see Execution mode). |
visibility | no | Public (default) or Internal. |
replacesGenericCreate | no | true on a Static method of a concrete type: the method replaces the generic create of the type, see Replacing the generic create. Default false. |
Parameter and result value types: String, Boolean, DateTime, DateTimeOffset, TimeSpan, Int, Int64, Double, StringArray, IntArray, Enum, Record.
Methods on interfaces use the same schema. Methods are inherited by derived types and by types implementing the interface.
Handler kind
execution.handler says who implements the method:
service(default, usually omitted): a service registers a handler for the method id.pipeline: the method is implemented by a pipeline; no service handler is expected. The deployed pipeline whose well-known name equals the qualified method id (for exampleAcme.Assets/Device.UpdateFirmware-1) handles the call. The key is lower-case: any other spelling or value is rejected with message 131.
methods:
- methodId: UpdateFirmware-1
execution:
timeoutSeconds: 120 # mandatory for a pipeline method
handler: pipeline
Rules (message 131): a pipeline method declares an explicit timeoutSeconds, and pipeline is declared on a type method, not on an interface method — a pipeline binds by the qualified method id of one type, so a type that implements an interface redeclares the method with handler: pipeline itself (execution is not part of the invocation contract, so this is allowed). A pipeline method must not have a sensitive parameter (message 132): a pipeline execution stores its input, so such a method is a service handler. Models that do not use the key compile exactly as before. At runtime the communication controller routes a pipeline call to the deployed pipeline of that name — see Pipeline method handlers.
Execution Mode
execution.mode says what a call returns:
sync(default, usually omitted): the call returns the result of the method (or an error) withintimeoutSeconds.async: the call returns an operation handle as soon as the handler has accepted the work; the result is read through the handle later.timeoutSecondsthen bounds the accept step (the time until the handle is returned), not the operation itself. The key is lower-case: any other spelling or value is rejected with message 142.
methods:
- methodId: Export-1
execution:
timeoutSeconds: 30 # bounds the accept step of an async method
mode: async
The mode is declared on the method definition; there is no per-call switch, so a method is synchronous or asynchronous for all callers. It is part of the invocation contract: a type that redeclares an interface method keeps the interface method's mode (message 122), and changing the mode is a Major change (see Versioning). Rules (message 142):
asyncrequires a service handler.asynctogether withhandler: pipelineis rejected: a pipeline handler answers synchronously only, and asynchronous methods are limited to service handlers of bot job types (decision OD-10).asynctogether withidempotent: trueis allowed: such a call skips the idempotency key store like a synchronous idempotent method.- The key needs
ckLanguage: 2; in a classic model it is reported with message 142 naming the method. - A model that sets the key on any method (also
sync) carries a raisedminEngineVersion(3.5.67), so an older engine refuses the model with message 126 instead of silently ignoring the key and running an asynchronous method synchronously.
Models that do not use the key compile exactly as before. What an accepted asynchronous call guarantees (at most once after accept, how long a handle lives, who may read it) is decided in OD-5; how a caller gets and reads the handle is described in Asynchronous callers.
Sensitive Results
A method whose result carries a secret (a generated password, an API key, a token) marks the result as sensitive:
methods:
- methodId: IssueToken-1
parameters:
- name: scope
valueType: String
result:
valueType: String
sensitive: true # optional, default false
The marker applies to the whole result value — a scalar, an enum or a record. Marking single attributes inside a record result is not possible: a record result that contains a secret is marked as a whole. A result of the value type Secret is not sensitive implicitly; the marker is always explicit. It is the counterpart of sensitive on a parameter, and like that one it is a statement in the model: the value must never be logged, audited or traced. The compiler records the marker, and the platform enforces it at runtime: the caller gets the real result, but the invocation filters (authorization, audit, idempotency) only see a redacted view in which the result is the JSON string "***", and the platform never writes the value into a log line, an exception message, a trace tag or a metric label. The same redaction applies when the method is not known to the platform (fail-closed). Error responses are not changed. The redacted view exists only inside the calling service; what travels between services is unchanged. A handler must still not write the value anywhere itself: the platform cannot know what a handler writes.
Rules:
- a method with a sensitive result must not use
execution.handler: pipeline(message 134): a pipeline execution stores its output, so such a method is a service handler. If a parameter is sensitive as well, messages 132 and 134 are both reported; sensitiveis a key of theresultblock, so a method without a result has nothing to mark;- a type that redeclares an interface method keeps the marker of the interface (message 122, the marker is part of the invocation contract);
- a model that marks a result needs a service whose engine knows the key. The compiler therefore writes a raised
minEngineVersioninto such a model, and an older service refuses it with message 126 instead of silently ignoring the marker and redacting nothing. Models that do not use the key compile exactly as before.
Replacing the Generic Create
A type whose entities must only come into existence through a defined operation (for example because a device has to be provisioned with a certificate) declares that operation as a static method with replacesGenericCreate: true:
types:
- typeId: Device
# ...
methods:
- methodId: Provision-1
kind: Static
replacesGenericCreate: true
parameters:
- name: serial
valueType: String
The flag is a statement in the model: entities of the type, and of every type derived from it, are created through this method. The compiler only records the flag; the asset repository enforces it by refusing the generic create of such a type with the error GENERIC_CREATE_REPLACED_BY_METHOD, which names the type and the method (see GraphQL mapping). Update and delete are not affected. A blueprint never runs a method either, so applying one that would create a new entity of such a type is refused, see Blueprints. The same holds for a data import: a runtime import started by a user (ImportRt) fails as a whole, before anything is written, when it would create a new entity of such a type, see Runtime import. Entities that already exist are updated as before. Pipeline nodes enforce the rule too, see Pipelines that insert entities.
Rules (message 133):
- only a
kind: Staticmethod can replace the generic create — an instance method needs an entity that does not exist yet; - not on an interface method, and not on a method of an abstract type: declare the method on the concrete type;
- at most one method per concrete type, counting the methods inherited from base types — otherwise it would be ambiguous which method creates the entity;
- the flag needs
ckLanguage: 2(message 90 in ackLanguage1 model).
A model that uses the flag can only be imported by a service whose engine knows the key. The compiler therefore writes a raised minEngineVersion into such a model, and an older service refuses it with message 126 instead of silently ignoring the flag. Models that do not use the key compile exactly as before.
Pipelines that insert entities
Pipeline nodes enforce the same rule. The nodes ApplyChanges@1, ApplyChanges@2 and ImportFromExcel@1 of the Mesh Adapter refuse to insert a new entity of a type whose method declares replacesGenericCreate (own or inherited), with one exception: the pipeline run that the platform started to execute that very method. The same guard applies to the other nodes that insert entities: CreateFileSystemItemUpdate, CreateZipArchive, RegisterSelfReportedMeteringPoint@1 and SaveTimeRangeSeriesInArchive@1. Only the platform's own NotificationDeliveryState type is exempt. Outside pipelines the same rule holds for the runtime import (ImportRt, message 137, see Runtime Import) and for blueprint seed data (message 136, see Blueprint Apply); a blueprint seed or an import is not a way around it.
- The method's own run inserts. When a call of the method starts its pipeline, the controller attaches a method-invocation marker to that run: the qualified method id, the invocation id, the type and the id of the bound pipeline. An insert passes only if the marker is present, its method id is the replacing method of the inserted type, and its pipeline id is the pipeline that is running. A method pipeline that inserts a flagged type of a different method is refused as well.
- Everything else is refused. A pipeline started by a trigger (HTTP request, schedule, event), by a manual execution (REST,
octo-cli, MCP, the web interface) or by another pipeline carries no marker. No public interface accepts a marker; a pipeline input that contains amethodInvocationmember is plain data. You therefore cannot test the insert of a method pipeline by executing it by hand: call the method instead. - Chained pipelines are refused. The marker does not travel over
ToPipelineDataEvent. The insert must happen in the method's own pipeline run; a pipeline that is triggered by a data event of the method's pipeline is refused, even when the data came from the method. - Whole batch, before any write. The node checks all update items of a batch first and refuses the whole batch if one insert is not allowed; nothing is written and the pipeline run fails. Only inserts are checked: updates, replaces and deletes cannot create an entity of that type and pass.
- Dry runs. The refusal applies in dry runs as well.
ImportFromExcel@1honours dry runs: it writes nothing and records what it would have written, after the refusal check (ImportFromExcel@1). - Flag added later. A flag that is added to a model takes effect in the pipelines after the Mesh Adapter has reloaded the CK cache of the tenant (when the model changes); until then the node still sees the old model.
- Retries. On a leased adapter a method run that was interrupted is retried with the same marker and the same invocation id, so a retry may run inserts again that the interrupted attempt already made. Write method pipelines so that they can run twice.
The refusal is reported by the failing node with these codes:
| Code | Meaning | What to do |
|---|---|---|
GENERIC_CREATE_REPLACED_BY_METHOD | The batch inserts an entity of a type whose generic create is replaced by a method, outside that method's run. The error names the type and the method and, per refusal, the reason: no marker, marker of another method, or marker of another pipeline. | Create the entity by calling the method, or let the method's own pipeline do the insert. |
GENERIC_CREATE_CHECK_UNAVAILABLE | The CK cache of the tenant is not loaded in the adapter and could not be loaded, so the check cannot be made. The batch is refused and nothing is written (fail closed). The error is retryable. | Run the pipeline again; investigate the adapter if it persists. |
Rollout order for operators
The check needs three components that know the marker. There is no compatibility switch: any switch could only fail open, so the behaviour is fail closed. Roll out in this order:
- Core libraries (
octo-sdk,octo-communication-sdk) with the core-libs release train. - Communication Controller with
System.Communication4.12.0. The controller seals the queued work of a leased adapter, so: switch the leasing kill switch off (it holds the queue), let queued leased executions drain or cancel them and let in-flight leases granted by the old pods finish (the stuck-execution reaper fails them after about 30 minutes), roll all controller instances, then switch leasing back on. The controller needs the engine key ring (SecretEncryption) and its admin database credential (OctoSystemConfiguration.AdminUserandAdminUserPassword). Details: Shared Adapter Leasing and Method invocation marker. - Mesh Adapter right after the controller.
During the roll the combinations behave as follows. A new controller with an old adapter: the adapter ignores the marker and has no refusal, so the insert is not yet protected until the adapter is upgraded. An old controller with a new adapter: no marker arrives, so the method's own run is refused; the method call fails, nothing is written. Existing tenants are not affected unless a model uses replacesGenericCreate.
Data Access
A method call is checked against the data permissions of the target record, like the generic mutation would be. The
authorization.dataAccess key declares which data permission the method needs:
methods:
- methodId: Describe-1
authorization:
roles: [ AssetManagement ]
dataAccess: Read # the method only reads its target
Write(default, also when the key or the wholeauthorizationblock is omitted): the method may change its target, the caller needs a write grant on the target record.Read: the method only reads its target, a read grant on the target is enough. Declare it only for query-like methods: aReadmethod is open to every caller who may merely see the record.Readis not allowed on a method withreplacesGenericCreate: true(message 135): creating an entity is a write.- The key needs
ckLanguage: 2. A model that uses it carries a raisedminEngineVersion, so an older engine refuses the model instead of treating aReadmethod asWrite.
dataAccess is independent of roles, allowSelf and scopes: those decide who may call the method at all, dataAccess decides which
grant on the target record the call needs. The data-permission check itself is performed by the method gateway of the asset repository.
dataAccess: Read reaches the CK cache of a tenant only when the services run an octo-construction-kit-engine-mongodb that persists the key. Until then every method is checked as Write, which is the stricter default, so a Read declaration can only be too strict, never too lax.
Calling a Method over GraphQL
Each method is a typed mutation of its type in the tenant schema: runtime { {type}s { {method}(rtId: ..., input: { ... }) { invocationId result } } }. Instance methods take the target rtId, static methods none; input has one field per declared parameter (required parameters non-null) and result is typed from the declared result. A failed call is one GraphQL error with extensions.code and extensions.parameters, including the error codes the method declares. A method inherited from a base type or an interface appears once on the derived type. Details and an example: GraphQL mapping.
Asynchronous callers
The mutation of an async method answers with operation { operationId acceptedAtUtc retryAfterSeconds expiresAtUtc } instead of result, once the handler has accepted the work and the platform has recorded the operation. The caller then reads runtime.operations(operationId: ...) until the state is SUCCEEDED (with result) or FAILED (with error), waiting retryAfterSeconds before the first read. Callers can list their own operations, tenant administrators every caller's; anyone else, an expired id and an unknown id get the same OPERATION_NOT_FOUND. The operation runs at most once: when its handler is lost it ends FAILED with METHOD_OUTCOME_UNKNOWN (reason = handler-lost) and is never restarted. A repeated idempotency key returns the same operation id. Fields, filters and examples: GraphQL mapping, Asynchronous methods and operations.
Who May Call
The platform enforces the authorization block for every call, over the bus and in-process alike; a handler does not have to implement it. Evaluation order: the scope octo_api and all listed scopes are required first (for administrators too); then a caller with one of the roles passes; then, with allowSelf: true on an instance method, the caller whose user id equals the target id passes (the ids are compared as parsed ids, so upper-case and lower-case hex are equal); a method without authorization or with empty roles is for administrators only (and the target itself if allowSelf is set). An administrator is not implicitly admitted to a method that lists roles: the declaration is the contract. A refused call is answered with the error METHOD_FORBIDDEN and the handler is not called. See method handlers for where the check runs.
The caller's tenant. The caller's token must have been issued for the tenant the call addresses (tenant_id claim, compared case-insensitively). Only a client-credentials (service) token of another tenant can pass, and only when its client is listed in TenantAuthorization:CrossTenantServiceClientIds; a user token of another tenant is always refused. A call that fails this check is answered with METHOD_FORBIDDEN and the parameter reason: tenant-not-allowed before the handler runs, and nothing is changed. The tenant is checked first: the GraphQL gateway judges it before the declared authorization, the target lookup and the parameter validation, so a token that fails this check gets the same tenant-not-allowed answer whether the target exists or not, whether its roles fit and whether its parameters are valid. The rule is the same on every transport: a remote handler checks the forwarded token itself, and for an in-process handler the platform checks it once, centrally, for every caller that comes with an access token, also while the HTTP tenant gate of a service only logs. A handler never checks the tenant itself.
Data Permissions
A method call on a record that data permissions protect is judged by the same rules as the generic mutation, so a method is no way around them. The gateway checks in this order: authenticate, the caller's tenant (above), declared authorization (above), load the target with the rights of the caller, data permission, parameter validation, dispatch. Because the declared check runs first and depends only on the method and the caller, a caller who may not call the method gets the same METHOD_FORBIDDEN whether the target exists or not.
- A target the caller cannot read is answered with
METHOD_TARGET_NOT_FOUND, exactly like a target that does not exist (same code, message and parameters): a hidden record cannot be told from a missing one. - A target the caller can read but not change is answered with
METHOD_FORBIDDEN(reason: data-permission); the handler is not called. - The data action of a method is
Writeunless the method declaresauthorization.dataAccess: Read; then a read grant is enough. allowSelfdoes not exempt this check. A user whose role has no grant on the user records is refused on their own record too; the model has to grant it, for example with an owned-only grant.- A
Staticmethod has no target: only the declaring type is judged (a missing grant isMETHOD_FORBIDDEN). - A policy in audit-only mode lets the call pass and writes the audit signal.
- Error texts and log lines never contain a parameter value, the access token or the id of a refused target.
Handlers still run with the rights of the service in this phase; the data permission is checked at the gateway, before the handler. A handler can therefore read and write other entities than its target without a data-permission check, so it must not do more than the method promises. A data access that is bound to the caller is the planned end state; the decision and its alternatives are recorded as OD-12.
Worked example: ChangePassword on the user's own record
System.Identity/User.ChangePassword-1 is declared with roles: [ UserManagement ] and allowSelf: true (see the example). Two different questions are asked, in this order:
| Step | Question | Decided by | Refusal |
|---|---|---|---|
| 1 | May this caller call the method at all? An administrator with UserManagement, or the user whose id equals the target id. | roles, allowSelf, scopes | METHOD_FORBIDDEN, reason: not-authorized, identical whether the target exists or not |
| 2 | May this caller change this record? The caller needs a write grant on the User records. | The data permissions of the tenant | METHOD_TARGET_NOT_FOUND if the caller may not even read the record, METHOD_FORBIDDEN with reason: data-permission if the caller may read but not write it |
allowSelf answers step 1 only. A user who passes step 1 on their own record is still refused in step 2 when their role has no grant on the user records. Because the user records of a tenant are usually protected, the model must give the grant that the method needs. A change of a password is a write, so the grant has to include Write:
# a permission, a policy that protects the user records, and the grant to the role of the users
octo-cli -c CreateDataPermission -pid "identity.users.self"
octo-cli -c CreateDataPolicy -pid "identity.users.self" -t "System.Identity/User" -a "Read,Write" -s OwnedOnly
octo-cli -c GrantDataPermission -pid "identity.users.self" -r <role of the users>
With the scope OwnedOnly, the grant applies only to records the caller owns (the creator of the record, or the owner attribute that the CK type names). A user record is owned by the user only if the model says so; if it does not, use a grant of the scope All for the role and rely on step 1 to keep a user away from other users' records (without UserManagement, allowSelf admits only the target itself). Check the result with a call that must fail: a user without the grant calls the method on their own record and gets METHOD_FORBIDDEN with reason: data-permission.
A caller who has no read grant at all sees the same answer as for an id that does not exist, METHOD_TARGET_NOT_FOUND; the method never confirms that a hidden record exists.
Limits of a Call
Every service that takes part in a method call enforces the same limits, so a caller cannot exhaust a service or make the platform show an error it did not issue:
- Size of the parameters. The parameter JSON of a call may be at most
Methods:MaxParametersBytesUTF-8 bytes, 1 MiB (1048576) by default; exactly the limit passes. The gateway of the asset repository refuses a larger call before it validates the parameters, and the handler host checks again on receipt, before it deserializes anything. The service-wide option has one name and is set per service in its configuration. Calls above the limit are refused from this release on: send fewer or smaller parameters and keep large content in a file. - Deadline. A handler host never keeps a call open longer than the platform maximum (
Methods:Dispatcher:MaxTimeout, default 10 minutes), whatever deadline the message carries; a method's owntimeoutSeconds(1-300) still applies first. - Error codes. A caller only sees platform codes and the codes the method declares. Any other code a responder writes becomes
METHOD_HANDLER_FAILEDwith a correlation id; the original code is only in the log.
| Platform code | Method ran | Parameters | Meaning |
|---|---|---|---|
METHOD_FORBIDDEN | no | methodId, reason | The caller may not call the method on this target. |
METHOD_TARGET_NOT_FOUND | no | methodId | The target does not exist or is not visible. |
METHOD_VALIDATION_FAILED | no | methodId, field, reason | A parameter is missing or invalid. With field = idempotencyKey the idempotency key is refused; the reason is parameters-changed, result-sensitive, caller-unknown, key-too-long, fingerprint-key-missing or fingerprint-unavailable (details). |
METHOD_PARAMETERS_TOO_LARGE | no | methodId, maxBytes, actualBytes | The parameters are larger than Methods:MaxParametersBytes (default 1 MiB). Do not retry unchanged. |
METHOD_HANDLER_NOT_AVAILABLE | no | methodId, reason | No live handler, or (reason = idempotency-store-unavailable) the idempotency store cannot decide. Retry later. |
METHOD_TIMEOUT | unknown | methodId, timeoutSeconds | No answer before the deadline. Check the state before retrying a non-idempotent method. |
METHOD_HANDLER_FAILED | failed | methodId, correlationId | The handler failed; details are in the handler log under the correlation id. |
METHOD_OUTCOME_UNKNOWN | unknown | methodId | A possible duplicate delivery was not run again, or an idempotency key whose first call had an unknown outcome was used again (the key is burned). Check the state first. |
METHOD_REQUEST_IN_PROGRESS | no | methodId | A call with the same idempotency key is still running; this call was not executed. Send the same key again later. |
Compiler Rules
| Rule | Message |
|---|---|
| A method id is unique on a type, and a type does not redeclare an inherited method id (no overrides) | 100 |
Parameters reference known records/enums, names are unique, Record/Enum have exactly the matching valueCkRecordId/valueCkEnumId | 101 |
The names Create, Update, Delete are reserved (case-insensitive) | 102 |
Error codes are unique and do not start with METHOD_ | 103 |
allowSelf: true is not allowed on a Static method | 104 |
A type redeclares an interface method with a different invocation contract (kind, parameters, result, error codes, execution.mode) | 122 |
Two methods of a model produce the same generated C# name (User + ChangePassword vs. UserChange + Password) | 125 |
execution.handler is not service/pipeline, a pipeline method has no explicit timeoutSeconds, or pipeline is declared on an interface method | 131 |
a pipeline method has a parameter marked sensitive | 132 |
a pipeline method has a result marked sensitive | 134 |
replacesGenericCreate is set on an instance method, an interface method or a method of an abstract type, or a concrete type has more than one such method (own or inherited) | 133 |
dataAccess: Read is set on a method with replacesGenericCreate: true, or the value is neither Read nor Write | 135 |
execution.mode is not sync/async, async is combined with handler: pipeline, or the key is used in a model without ckLanguage: 2 | 142 |
Generated Code
For each type method the source generator emits:
- a method id constant in the model's
*CkIdsclass, e.g.DeviceUpdateFirmwareMethodId = "Acme.Assets/Device.UpdateFirmware-1"(a version above 1 is appended:DeviceUpdateFirmware2MethodId); - a parameter record
DeviceUpdateFirmwareParameters(required parameters arerequired, optional ones nullable;sensitiveparameters print as***inToString()); - a result record
{Type}{Method}Result { Value }when the method has a result (asensitiveresult prints asValue = ***inToString()).
Interface methods get no records.
Versioning
- A new method is a Minor change.
- Marking a result
sensitive(false→true) is Minor: more protection, callers are unaffected. Withdrawing the marker (true→false) is also Minor, but it removes a redaction, so the author must acknowledge it incompatibility.acknowledgewith a reason that names the security impact. On an interface method both directions are Major. - Changing
execution.handler(service↔pipeline) is Major; addinghandler: serviceto a method without the key is no change. - Changing
execution.mode(sync↔async) is Major in both directions: callers receive an operation handle instead of the result, or the other way round — publish a new method version (Export-2). Addingmode: syncto a method without the key is no change. - Setting
replacesGenericCreateon an existing method (false→true) is Major: callers that create entities of the type generically break. Removing the flag (true→false) is Minor. A new method with the flag on a type that already existed in the previous version is Major as well (existing callers lose the generic create); on a new type it is Minor. Publish a new type or method version instead of changing an existing one. - Declaring
dataAccess: Readon an existing method (Write→Read) is Minor and must be acknowledged incompatibility.acknowledgewith a reason that names the security impact: a caller who may merely read the target can now call the method. Changing it back (Read→Write) is Major: callers with only a read grant lose access — publish a new method version.dataAccess: Writeequals the omitted key. - Removing a method, or changing its signature (kind, parameters, result, errors, authorization,
idempotenttofalse), is Major — publish a new method version (UpdateFirmware-2) instead. descriptionand parameter/error descriptions are Patch changes; they are not part of the signature.
See Also
- Access modifiers —
access: MethodOnly - Interfaces
- Implementing method handlers — handler per transport, worked example
- Method consistency model — transactions, failures, retries, idempotency
- Compiler messages