How to get the "@odata.type" entries in the serialized content?
See original GitHub issueAs is, the generated code creates a body that looks something like this
{
"ExtractionRequest": {
"ContentFieldNames": [
"RIC",
"Round Lot Size",
"ISIN",
"Currency Code"
],
"IdentifierList": {
"InstrumentIdentifiers": [
{
"Identifier": "IBM.N",
"IdentifierType": "Ric"
}
]
},
"Condition": {
"FixedIncomeRatingSources": "None"
}
}
}
But the API I am using will only work if I POST it something like this
{
"ExtractionRequest": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.TermsAndConditionsExtractionRequest",
"ContentFieldNames": [
"RIC",
"Round Lot Size",
"ISIN",
"Currency Code"
],
"IdentifierList": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
"InstrumentIdentifiers": [
{
"Identifier": "IBM.N",
"IdentifierType": "Ric"
}
]
},
"Condition": {
"FixedIncomeRatingSources": "None"
}
}
}
For reference the API I am using is found at “https://selectapi.datascope.refinitiv.com/RestApi/v1/Extractions/$metadata”
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (7 by maintainers)
Top Results From Across the Web
Customize OData payload serialization format within ASP. ...
OData media type resolving is designed to get an ODataFormat based on the request metadata, such as Content-Type header, Accept header, etc.
Read more >JSON.NET as a WebAPI 2 OData serializer vs ...
I've implemented JsonMediaTypeFormatter, in which I've used JSON.NET serializer for serialize/deserialize data and created JsonContentNegotiator ...
Read more >Serialize content of Dictionary<string, string> · Issue #438
Hi,. I have an entity with a property of type Dictionary<string, string>. Existing data in the dictionary is not serialized in responses.
Read more >JSON Format (OData Version 2.0)
OData supports two formats for representing the resources (Collections, Entries, Links, etc) it exposes: the XML-based AtomPub format and the JSON format. This ......
Read more >Working With OData in ASP.NET Core
The same goes for serialization: rather than using the default ASP.NET Core formatters, OData-specific formatters are used.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The serializer seems to be the problem for some reason 😓 will look into it tomorrow again
Looks good!