If you're using the Alfresco Maven SDK to create a JAR/AMP, you can create that file in "/src/main/resources/alfresco/extension/templates/webscripts/alfresco/slingshot/documentlibrary-v2/item.lib.ftl". This is a Repository extension.
Unfortunately, it appears to be not working (or I did it wrong): the same old "item.lib.ftl" from share is used by the system. (I did the test by calling "alfresco/s/slingshot/doclib2/node/workspace/SpacesStore/XXXXX" and check the JSON result).
My file is located in the JAR : alfresco/extension/templates/webscripts/alfresco/slingshot/documentlibrary-v2/item.lib.ftl
Is there any configuration xml file to modify/add or just creating the new file in this location should be enough ?
EDIT : Ok I didn't see your second reply. Thank you for information