Clarify resolution of templates without package ID (#14601)

* Clarify resolution of templates without package ID

In particular, with regards to the HTTP JSON API service.

changelog_begin
changelog_end

* Emphasize use case for package ID resolution

Suggested by @garyverhaegen-da

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>

* Emphasize further

* Fix RST formatting

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
This commit is contained in:
Stefano Baghino 2022-08-03 13:34:16 +02:00 committed by GitHub
parent 3aaf78f9be
commit c99611ec14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -540,10 +540,7 @@ HTTP Request
Where:
- ``templateId`` is the contract template identifier, which can be formatted as either:
+ ``"<package ID>:<module>:<entity>"`` or
+ ``"<module>:<entity>"`` if contract template can be uniquely identified by its module and entity name.
- ``templateId`` is the contract template identifier, which is formatted as ``"<package ID>:<module>:<entity>"``. As a convenience for interactive API exploration (such as with curl and similar tools), you can also omit the package ID (i.e. specifying the ``templateId`` as ``"<module>:<entity>"``) **if there is only one template with that name across all loaded packages**. Code should always specify the package ID, since it's common to have more versions of a template sharing the same module and entity name but with different package IDs. If the package identifier is not specified and the template cannot be uniquely identified without it, the HTTP JSON API service will report that the specified template cannot be found. **Omitting the package ID is not supported for production use.**
- ``payload`` field contains contract fields as defined in the Daml template and formatted according to :doc:`lf-value-specification`.