Skip to content

Add option to use relative uris for requests with associations#890

Open
m2307 wants to merge 3 commits intosimple-odata-client:mainfrom
m2307:master
Open

Add option to use relative uris for requests with associations#890
m2307 wants to merge 3 commits intosimple-odata-client:mainfrom
m2307:master

Conversation

@m2307
Copy link

@m2307 m2307 commented Jan 13, 2023

Adds a new option UseAbsoluteAssociationsUri in the settings, when disabled, relative urls are used in the associations (e.g. @odata.bind)

Request will go from:"

{
"@odata.type": "#ODataDemo.Product",
"ID": 1007,
"Name": "Test6",
"Description": "Test1",
"Price": 18.0,
"Rating": 1,
"ReleaseDate": "2023-01-13T13:46:45.6218006+01:00",
"Categories@odata.bind": ["https://services.odata.org/V4/OData/(S(iemb1b0csyws2o44cd4mmntn))/OData.svc/Categories(1005)"]
}

to

{
"@odata.context": "https://services.odata.org/V4/OData/(S(j3mvzffkbihcxf4lcocivxhk))/OData.svc/$metadata#ODataDemo.Product",
"@odata.type": "#ODataDemo.Product",
"ID": 1007,
"Name": "Test6",
"Description": "Test1",
"Price": 18.0,
"Rating": 1,
"ReleaseDate": "2023-01-13T13:46:42.76828+01:00",
"Categories@odata.bind": ["Categories(1005)"]
}

@m2307 m2307 changed the title Add option to use relative uris for requests for associations Add option to use relative uris for requests with associations Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants