Christoph John created TEIID-5803:
-------------------------------------
Summary: Seems to be not possible to POST a new entity via a navigation
property to a collection
Key: TEIID-5803
URL:
https://issues.jboss.org/browse/TEIID-5803
Project: Teiid
Issue Type: Bug
Reporter: Christoph John
Assignee: Steven Hawkins
Hello Steven,
I am currently trying to post/create an entity into a collection via a relative binding.
Unfortunately, I always get an error saying
{"error":{"code":null,"message":"HTTP method
'POST' not allowed for this resource."}}
I have bound the root view to .../Account(1) from which I have a navigation property to
the relevant collection. Currently I have trouble to post to collections via a navigation
path.
Might you tell me if my path via the navigation property should work for post requests?
Directly writing to the collection is fine, i.e. something like the following:
curl --user sap:sap -i -X POST -H 'Content-Type:
application/json;charset=UTF-8;IEEE754Compatible=true' -d
'{"fkProfile":"1","idCode":null,"lc":"de","product_name":"A
Product","brands":"A
brand","energy_100g":2259,"carbohydrates_100g":60.08,"sugars_100g":10.1,"proteins_100g":24.03,"fat_100g":15.89,"saturated_fat_100g":10.0,"salt_100g":1.0}'
http://localhost:18080/odata4/svc/my_nutri_diary/UserDefinedProducts
and a GET request via the following navigation property path also works, but not when
using the path in a POST request. I.e. when going via the navigation property via
curl --user sap:sap -i -X POST -H 'Content-Type:
application/json;charset=UTF-8;IEEE754Compatible=true' -d
'{"fkProfile":"1","idCode":null,"lc":"de","product_name":"A
Product","brands":"A
brand","energy_100g":2259,"carbohydrates_100g":60.08,"sugars_100g":10.1,"proteins_100g":24.03,"fat_100g":15.89,"saturated_fat_100g":10.0,"salt_100g":1.0}'
http://localhost:18080/odata4/svc/my_nutri_diary/Account\(1\)/UserDefined...
it does not work.
Here you find the backend metadata:
https://ecubed-solutions.ddnss.de/odata4/svc/my_nutri_diary/$metadata
user: sap
password: sap
Thanks a lot for your help!
Note: I am currently trying to add data via a navigation property path as my frontend
library sapui5 caches and syncs data in a single context binding only. Hence, to be
consistent via all application views which bind to the model I just want to use one one
absolute binding and relative data bindings from there to allow all frontend views to
maintain data consistency
--
This message was sent by Atlassian Jira
(v7.12.1#712002)