question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to get the "@odata.type" entries in the serialized content?

See original GitHub issue

As 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:closed
  • Created 2 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Zaid-Ajajcommented, Aug 11, 2021

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

0reactions
travis-leithcommented, Aug 12, 2021

Looks good!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found