Questions tagged [odata]
The Open Data Protocol (OData) is a standardized protocol for building REST APIs. OData specifies many best practices for REST APIs, including a terse, hypermedia-oriented JSON format. Use this tag for all specification versions (v2, v3, v4.x).
7,204
questions
0
votes
0
answers
9
views
System.ArgumentNullException : Value cannot be null. (Parameter 'type') OData Unit Test upgrade to .NET 6.0
I have recently upgrading to .NET 6.0 and am now experiencing a previously unseen error before in my OData Unit Test project. I am experiecing a: System.ArgumentNullException : Value cannot be null. (...
0
votes
0
answers
10
views
Does OData do its filtering on the database or on my iis host?
If I implement the following API
toystore.com/api/toys?$select=prodId&$filter=startswith(CompanyId, 'lego')
in ASP.NET MVC, using OData3 and EF - does that query get evaluated on my database (...
0
votes
0
answers
7
views
OData query for the SharePoint API
I am trying to filter the recourses the I receive from calling the SharePoint API and I run into a problem of how to filter the data based on child elements.
EX: I only want the items that contain ...
0
votes
0
answers
4
views
How to create multiple entities using a single OData POST to a Business Central Web Service?
I tried to POST an array of objects and, as expected, it isn't that easy. In my case I want to insert multiple Transfer Order Lines in the same request.
// Request Body
[
{
"...
0
votes
0
answers
24
views
Microsoft.AspNetCore.OData 8.0.10 routing issue
I am using ASP.NET Core 5.0 Web api project. On top of this project I have installed Microsoft.AspNetCore.OData 8.0.10 nuget package to enable OData support.
This is how my routes are currently setup:
...
1
vote
2
answers
22
views
Set custom route using OData 8
Recently I updated to OData 8.0.10. I added this in my Startup.cs file:
services.AddRouting();
services.AddControllers().AddOData(opt =>
opt.AddRouteComponents("odata", GetEdmModel())....
0
votes
1
answer
48
views
ASP NET Core .NET 6 and OData - how to return lowercase json
Odata controllers in my project returns jsons with casing as it is in class so PascalCase.
I want to make them return json with camelCase props.
Controllers which don't use OData returns camelCase ...
0
votes
0
answers
31
views
InvalidDataContractException: Type cannot be serialized. Consider marking it with the DataContractAttribute attribute
I'm having a problem getting the XML datatype from the API with OData Query, when I use OData Query to get the XML datatype or format it gives me an ERROR:
InvalidDataContractException: Type '...
0
votes
0
answers
41
views
Object of type System.Linq.EnumerableQuery cannot be converted to type System.Collections.Generic.IEnumerab
I'm running into a problem retrieving XML datatype with OData Query on the Web API, but in JSON format there is no problem at all.
Error saying this :
ArgumentException: Object of type 'System.Linq....
1
vote
2
answers
45
views
OData doesn't return context and count after upgrading to .NET 6
I used .NET 3.1 until I decided to upgrade my app to .NET 6. I did it successfully but some of my modules broke, one of them is OData. I used OData and I got @odata.context, @odata.count and value ...
2
votes
0
answers
16
views
SAPUI5 & OData v4: Update of derived entity leads to Error: Not a (navigation) property
OpenUI5 version: 1.95
Browser/version: Chrome Version 101.0.4951.67
I have an OData v4 service with following Entity types (snippet from metadata document):
"name.space": {
"$Alias&...
0
votes
0
answers
27
views
Dynamic container name when mapping Cosmos DB using EF Core
I have an OData endpoint which query collection of Cosmos entity. The Cosmos DB container name is dynamic so that I cannot use entity.ToContainer("<container name>") in the model ...
0
votes
0
answers
20
views
How to check if a property is $select-ed?
I am building an OData web API, and I am trying to implement this function to determine whether a given property should be included in a GET response based on the $select value in the query:
bool ...
0
votes
0
answers
25
views
My EF Core 6 OData endpoint is returning whole infrastructure instead of model?
My EF Core application is returning what I imagine is context information in response instead of model. When calling the endpoint with expand option. This is the result returned:
{
"$id": &...
0
votes
1
answer
56
views
Scaleproblem: VizFrame Dual Barchart Rendering of Values
I made a dual barchart with vizframe, but I ran into a problem.
The values of the two datasets don't render on the same scale.
This makes the comparison of the datasets near impossible.
Example:
show ...
0
votes
0
answers
18
views
Creating Username and password in Generic OData services
We would like to know how can we create username and password in Generic Odata.
we followed links available in Google couldnt succeed and anyone can have steps please do share with us
0
votes
1
answer
54
views
How to get all guest users count in M365 groups with Microsoft graph api
I tried to get all guest users count in all M365 groups in single Microsoft graph api call I have written below query for that.
https://graph.microsoft.com/v1.0/users?$expand=memberOf($filter=...
-2
votes
0
answers
16
views
I am trying to retrieve data from odata into grid table in UI. I am trying to fetch boolean value. how to set property boolean in xml [closed]
Log-dbg.js:456 2022-05-11 14:28:30.522300 FormatException in property 'text' of 'Element sap.m.ObjectStatus#__status7-__clone2': Type 'sap.ui.model.odata.type.Raw' does not support formatting
Hint: ...
-1
votes
0
answers
25
views
SAPUI5. Odata. Save some records
I need to save some record.
var mParameters = {};
for (i=...) {
oData = oMass[i];
mParameters.groupId = "changesGroup" + i;
oModel.create("/Set", oData, mParameters);
}
for (...
0
votes
0
answers
22
views
How to connect power bi reports to OData using data Gateway
I have developed Power Bi report using OData Source and deployed in power bi service. Need to do schedule refresh for the report. For that created and configure the connection to OData in Power BI ...
0
votes
0
answers
13
views
Use HttpClientHandler with ODataClient
I have a custom HttpClientHandler class which inherits from HttpClientHandler and for most scenarios it is used with the HttpClient as var client = new HttpClient(new CustomHttpClientHandler()) and it ...
0
votes
1
answer
23
views
OData v7 & 8 - Should Composite Keys be in Alpha Order or HasKey when key value binding?
Odata seems to want keys in alpha order when using key value binding convention.
The below document suggests it should be in the order defined in HasKeys, as the keys aren't in alpha order.
https://...
0
votes
0
answers
36
views
How to use /$query with Microsoft Odata Client (Connected Service)?
In general you transmit odata filter parameters via query parameters in the URL and this has known length limits. To workaround that issue Microsoft.AspnetCore.OData supports the use of the generic /$...
0
votes
0
answers
19
views
Recreate ODataQueryOptions from Request URL
In my ASP.NET Core 3.1 project
I have a RabbitMQ consumer setup to fetch Database records. I am passing the OData based request URL with $expand, $filter, $count, $select as AllowedQueryOptions. I ...
1
vote
0
answers
47
views
.Net 6 Nullable String Parameter set to "Microsoft.OData.ODataNullValue" instead of null
I'm in the process of upgrading an Entity Framework API project from .Net 5 to .Net 6 and I'm having issues with one of the functions when trying to pass a null value for a string parameter.
As part ...
0
votes
1
answer
32
views
How to add credentials to ODATA Microsoft dynamics web service, on Visual Studio 2019
The Microsoft dynamic web service link when used on a browser prompts the Credentials as shown in the image below
The issue is how to pass this credential to Visual studio in order to avoid the ...
0
votes
0
answers
24
views
Using variables in oData URL in Excel Power Query
I'm trying to make a dynamic oData URL. This works, but it applies the filter after downloading the data set. I need to use query folding, so it applies filter in the oData Query.
Can someone point me ...
0
votes
0
answers
52
views
Azure Blob Starage - Rest API - 400 One of the request inputs is not valid
I am trying to delete a blob from an Azure Blob Storage with a batch request.
At the moment I am using postman to verify my request before I use it in my application.
I cannot manage to get a ...
0
votes
1
answer
23
views
Filtering query by the field: recurrence/range/endDate
Is it possible (using Graph Api) to filter query by recurrence/range/endDate event field?
For other data types it works, but for the endDate field, which is a Date object, I get this error:
{
&...
0
votes
0
answers
52
views
Is it possible to use the same search field to filter multiple tables? SAP Ui5
My fiori application has multiple tables, each with its' own search bar, in separate nested views. Is it possible to filter all tables using the same search bar? The code below works for filtering the ...
0
votes
0
answers
11
views
OData Detla<Entity>Patch not updating
I'm currently trying to hack Odata when updating.
I have the following model:
public class Patient
{
[DataMember]
[JsonPropertyName("id")]
public string Id { get; set; }
...
0
votes
0
answers
18
views
How to create custom odata query parameter
I would like to create a custom OData query parameter in my project. The idea would be to add $takeOneElementEach={n} as an optional query string parameter when [EnableQuery] is on an action.
Since ...
0
votes
0
answers
41
views
SAP OData Gateway from Angular 8 - I send Content-type=application/JSON but Response becomes Content type= Text and fails...Why?
I don't have the experience to solve this...Please help if you can.
I am making a POST call from Angular 8 to SAP Gateway using OData Version 2.
I am getting a 500 error which I understand is due to ...
0
votes
0
answers
21
views
API not returning data randomly
I am using DX web API Backend Web API Service. I have a strange issue.
I have deployed the DX web api to IIS on a Windows Server 2019. Occasionally in Postman (and in client Xamarin app) when a OData ...
1
vote
1
answer
80
views
How can I get the count of filtered OData results? [duplicate]
I am attempting to get the count of filtered OData results in a Fiori SAPUI5 application. I am able to get the correct count using both $count and $inlinecount in Postman using the following:
...
0
votes
1
answer
57
views
How to do custom function routing in C# / ASP.NET Core 6 Web API Server OData controller?
I am trying to implement a custom function in my OData based controller. This function should create a number of test records in the database. The number of test records to be created is passed as ...
0
votes
0
answers
18
views
Swagger error - Actions require a unique method/path combination
I've read many posts on this subject and tried many answers and I'm still getting this error. The Api still works on it's own, the api simply seems to break Swagger.
I'm getting this error on these ...
-1
votes
0
answers
11
views
$groupby not working in OData v4 OData svc API
I'm working on Odata V4 and want to use groupby clause to get data from OData svc API.But its not working .getting below error
HTTP/1.1 400 BadRequest
Content-Type: application/xml;charset=utf-8
The ...
0
votes
1
answer
69
views
OData 8.0.10 Could not load type 'Microsoft.AspNet.Odata.MetadataController' upon startup
I recently tried upgrading my OData project from .NET 5.0 to 6.0, requiring an upgrade to OData 8. I went through the docs to make the breaking changes build, but am getting this error at startup. ...
0
votes
0
answers
20
views
How to connect Azure REST API with OData client?
How to connect Azure REST API with OData client? Does the current Azure Rest API follow OData schema? If yes, how do I connect in my OData client.
1
vote
0
answers
23
views
How to use pivot in LINQ efficiently?
I searched for how to do pivot data with LINQ and found THIS
I am trying apply this for my OData API service.
Table Data has composite key as { Id, Name, DataType }.
Table Analyses has key as Id.
So, ...
0
votes
0
answers
6
views
OData pagination when expending args from other tabels
I am running an OData query as follows:
someurl?expend=sometabelname($select=foo,bar,baz)
So the response is something like
{
odata.nextLink
[somedata]
sometabelname:{[somedata (foo, bar, baz]} //...
0
votes
1
answer
34
views
AAD B2C - Add user to group via post to GrapAPI in Azure function
In a signup custom policy, after the user is created, I want to add him or her to a group. I tried to do it the same way I get the group membership in my signin policy, with a custom Azure function ...
-4
votes
0
answers
25
views
How can I filter the variable I want in the master's row in the Odata query?
I just want to filter the row
I want to talk like in the picture.
Ex: ItemCode only 5000022 in Stocktransferline
0
votes
0
answers
27
views
LINQ query along with OData query is returning an error
Background
I've got a controller which in short returns:
context.Table.Where(x => x.AccID == accID && x.uID == uID).Select(x => new BaseModel(x)).Take(5).AsQueryable<BaseModel>()
...
0
votes
0
answers
31
views
Zendesk API response for custom fields in Power Automate Connector
I'm trying to setup a Power Automate flow to begin on a ZenDesk connector where, under the Filter Query to establish the starting parameters, a custom field within ZenDesk is designated in the OData ...
0
votes
0
answers
15
views
OData Count and ODATA context fields not in response
I would like to use ODATA. Unfortunately I get neither count nor odata.context back. Select, filter, orderBy are working though. Does anyone have an idea where my error is?
[AllowAnonymous]
[...
-1
votes
0
answers
38
views
Odata $expand throwing ArgumentException on nested collection property
I am using .Net Core 3.1 with EF Core & Odata Web API. I am trying to return eagerly loaded data as IQueryable mapped with AutoMapper but I get argument exception like below.
System....
0
votes
1
answer
32
views
OData Queries on Entities with Dynamic Fields
I am using OData on a dynamic model. The MyObject data is stored in two different ways on the database - in a main MyObject table and in a secondary table of key/value pairs. The allowed field names ...
0
votes
1
answer
30
views
Using oData to select from Azure Dev Ops Project all open tickets and their children
I am a novice :-)
I have an ado project where the ticket hierarchy is "EPIC - Feature - User Story - Bugs or Tasks - Tasks so up to 5 levels.
I want to be able to pull into Power BI using OData ...