Migrate from deprecated provider fields
Use this example when T-Invest deprecates a field and your application needs to move to a current field without changing its meaning. Keep the old field only where compatibility requires it and handle the new field independently. The migration then preserves the behavior of API calls, CLI output, and the application model.
Preserve the fidelity of generated types
Public generated types mirror the T-Invest contract, including @deprecated annotations. Before exposing such a field in a stable domain or HTTP model, verify its business meaning and the contract of its replacement.
klong and kshort describe the client's risk-rate coefficients. dlong and dshort describe initial margin risk rates. The SDK keeps dlong/dshort and klong/kshort separate, with the meanings assigned by the provider.
Public generated DTOs mirror the upstream contract exactly. Direct service calls continue to return klong and kshort for as long as the T-Invest API includes them.
Preserve CLI compatibility
CLI reports in 0.4.x kept klong and kshort for compatibility. Starting in 0.5.0, normalized CLI JSON output omits these fields. dlong and dshort remain independent fields, and their values retain their original meaning.
The CLI alias --figi remains available for compatibility and maps to the current protobuf field instrumentId. The built-in CLI leaves deprecated FIGI fields in requests and subscriptions at their protobuf defaults, so they are omitted from serialization. Applications that call the service facade directly still control the generated request.
Update the application model
- Keep deprecated provider fields inside the transport adapter unless the application has a confirmed business use for them.
- Deprecate already published
klong/kshortfields and retain them during migration if external clients depend on them. - Model
dlong/dshortseparately and preserve the semantics ofklong/kshort. - Isolate temporary reads of deprecated fields and document each
typescript/no-deprecatedsuppression in the T-Invest adapter.