Skip to content

Clerk.BackendAPI.Models.Operations.Actor lacks required Sub property #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jfoshee opened this issue Jan 29, 2025 · 2 comments
Closed

Comments

@jfoshee
Copy link

jfoshee commented Jan 29, 2025

As mentioned in the documentation (and observed in practice) Clerk.BackendAPI.Models.Operations.Actor must have a Sub property (serialized as sub).

That said, idiomatic C# does not usually use abbreviated identifiers.
So, it would be nice if the property was named SubscriberId or UserId.

Work-around:

In the mean time, consumers can locally derive a type:

class ActorWithSub : Actor
{
    required public string Sub { get; set; }
}

Example usage:

var request = new CreateActorTokenRequestBody
{
    UserId = "user_1234",
    Actor = new ActorWithSub { Sub = "user_1234" },
    ExpiresInSeconds = 60,
    SessionMaxDurationInSeconds = 60,
};
var response = await sdk.ActorTokens.CreateAsync(request);
@logangingerich
Copy link
Collaborator

Hey @jfoshee ! Thanks for reporting this, the team and I are taking a look now. Appreciate you putting out this workaround as well!

I'm going to investigate implementing this by altering the schema via the overlay file, and will keep you in the loop on how it goes!

@logangingerich
Copy link
Collaborator

Thanks again for reporting! We've made some updates in the latest release based on the feedback: https://github.com/clerk/clerk-sdk-csharp/releases/tag/v0.5.0

Closing this out for now, but feel free to re-open if you have any issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants