Skip to content

ODataLib Client fails to deserialize payload with @odata.context relative URL. #1208

Closed
@VirusQuartirus

Description

@VirusQuartirus

When JSON Lite payload contains @odata.context annotation with relative URL instead of absolute URL OData .NET client fails to deserialize response.

Assemblies affected

OData .Net lib 7.5.0.

Reproduce steps

Read response with relative URL in @odata.context annotation. (Use Fiddler Autoresponder?).

Expected result

Client should deserialize response as usual.

Actual result

Client fails with following error:
Microsoft.OData.ODataException: 'The top level context URL '$metadata#FooBar' should be an absolute Uri.'.

Additional detail

According to OData V4 spec:
The context annotation returns the context URL (see [OData-Protocol]) for the payload. This URL can be absolute or relative.
This output comes from Java Olingo implementation and we are blocked by this issue right now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclientonly related to OData.Client

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions