ory / ory/hydra-client-dotnet

Data Type Mismatch for `SkipLogoutConsent` Property

Open
#5 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
5
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Preflight checklist
Ory Network Project

No response

Describe the bug

There appears to be a data type mismatch between the SkipLogoutConsent property in the .NET SDK and its definition in the Ory Hydra API. This issue causes deserialization failures when handling responses from the endpoint, leading to request failures.

In the latest update of the .NET SDK, the SkipLogoutConsent property is defined as a bool type. However, in the Ory Hydra source code, this property is nullable, meaning it can return null from the API endpoint. This discrepancy results in deserialization errors when the API response contains null for the skip_logout_consent field.

Affected Code
  • .NET SDK Definition :
    The SkipLogoutConsent property is defined as a bool in the .NET SDK:
    Link to .NET SDK Code
  • Ory Hydra Definition :
    In the Ory Hydra Go client, the SkipLogoutConsent property is nullable:
    Link to Ory Hydra Code
  • Deserialization Failure :
    The deserialization error occurs in the .NET SDK when processing the API response:
    Link to Deserialization Code
Root Cause

The root cause of the issue is that the SkipLogoutConsent property in the .NET SDK is defined as a non-nullable bool, while the Ory Hydra API allows it to return null. When the API response includes null for this field, the deserialization process fails because null cannot be directly assigned to a bool.

Impact

This issue prevents successful deserialization of the API response, causing requests to fail whenever the skip_logout_consent field is null.

Proposed Solution

To resolve this issue, the SkipLogoutConsent property in the .NET SDK should be updated to accommodate nullable values or Ory Hydra API should always return a bool value.

Reproducing the bug
  1. Make a request to an Ory Hydra endpoint that includes the skip_logout_consent field.
  2. Ensure the response contains null for the skip_logout_consent field.
  3. Observe the deserialization failure in the .NET SDK.
Relevant log output

Relevant configuration

Version

2.2.1

On which operating system are you observing this issue?

Windows

In which environment are you deploying?

Binary

Additional Context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/Ory.Hydra.Client/Model/HydraOAuth2Client.cs at the SkipLogoutConsent property, then inspect deserialization in src/Ory.Hydra.Client/Client/ApiClient.cs. Compare the SDK definition with the linked Ory Hydra client definition and reproduce a response containing a null skip_logout_consent value. Done means the SDK can deserialize that response without failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.