documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Adding Computed fields to API

Open jimohalloran opened this issue 5 years ago • 0 comments

The documentation for adding a computed field to the API (https://doc.oroinc.com/backend/api/how-to/#add-a-computed-field) seems to be lacking in one important detail. If you follow the instructions as written you can no longer update the entity via the API as the computed field isn't mapped by the form type class. The solution (supplied by @vsoroka in Slack - https://orocommunity.slack.com/archives/C11NBUUGY/p1604973667120900?thread_ts=1604971873.120700&cid=C11NBUUGY ) is to add the following to api.yml:

form_options:
    mapped: false

It might be good if the documentation mentioned this so others don't inadvertently break their API following the documentation.

jimohalloran avatar Nov 10 '20 03:11 jimohalloran