You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I Cannot get the @sap.isPartial annotation from IEdmModel obtained by using the following code:
using var odataEdmModelReader = new ODataMessageReader((IODataResponseMessage)odataInMemoryMetadataStream, ODataReaderSettings);
var settings = new CsdlJsonReaderSettings()
{
IgnoreUnexpectedJsonElements = true,
};
var odataEdmModel = odataEdmModelReader.ReadMetadataDocument(settings);
If I set the IgnoreUnexpectedJsonElements property to false, I get the following exception:
Microsoft.OData.ODataException: The metadata document could not be read from the message content.
UnexpectedElement : A member '$.Flows.Flows.Flows0.$Kind' with value type 'String' is unexpected. : $.Flows.Flows.Flows0.$Kind
UnexpectedElement : A member '$[email protected]' with value type 'False' is unexpected. : $[email protected]
Expected result
These annotations shouldn't be considered as invalid elements, but stored as annotations so we can retrieve them in the IEdmModel.
Actual result
These annotations are not found in the IEdmModel but instead generate errors in the model.
The text was updated successfully, but these errors were encountered:
The error involving the top-level annotation appears to be a bug. I got a similar error trying to parse one of the sample schemas in the CSDL JSON spec.
The other error related to the Flows0.$Kind entity set does not appear to be a bug, but rather an error in your schema. Here's the correct way to represent an entity set
Cannot get top level annotation from IEdmModel using ODataMessageReader.ReadMetadataDocument method.
Assemblies affected
Microsoft.OData.Core lib 7.x*, 8.x*
Microsoft.OData.Edm lib 7.x*, 8.x*
Reproduce steps
Consider this OData metadata content:
I Cannot get the @sap.isPartial annotation from IEdmModel obtained by using the following code:
If I set the IgnoreUnexpectedJsonElements property to false, I get the following exception:
Microsoft.OData.ODataException: The metadata document could not be read from the message content.
UnexpectedElement : A member '$.Flows.Flows.Flows0.$Kind' with value type 'String' is unexpected. : $.Flows.Flows.Flows0.$Kind
UnexpectedElement : A member '$[email protected]' with value type 'False' is unexpected. : $[email protected]
Expected result
These annotations shouldn't be considered as invalid elements, but stored as annotations so we can retrieve them in the IEdmModel.
Actual result
These annotations are not found in the IEdmModel but instead generate errors in the model.
The text was updated successfully, but these errors were encountered: