What happened?
Deserializing any GitHub API response whose account type is "enterprise" throws an ArgumentException. This affects enterprise-owned GitHub Apps, which became generally available on 2025-03-10 and return owner.type = "enterprise" from endpoints such as GET /app.
The AccountType enum (Octokit/Models/Response/AccountType.cs) only defines User, Organization, Bot, and Mannequin. Account.Type is a raw AccountType? rather than a StringEnum<AccountType>, so SimpleJsonSerializer calls Enum.Parse(..., "enterprise", ...) and throws for the unknown value.
var serializer = new SimpleJsonSerializer();
var app = serializer.Deserialize<GitHubApp>(json); // json has owner.type = "enterprise"
Versions
Octokit.NET 14.0.0
Relevant log output
System.ArgumentException: Requested value 'enterprise' was not found.
at System.Enum.TryParseByName(...)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at
Octokit.Internal.SimpleJsonSerializer.GitHubSerializerStrategy.DeserializeEnumHelper(String
value, Type type)
at Octokit.Internal.SimpleJsonSerializer.Deserialize[T](String json)
Notes
Same root cause as #2998 (reported for CheckRunEventPayload); PR #2999 proposed adding the enum member but was auto-closed by the stale bot without merging. This issue tracks the same missing Enterprise account type.
Code of Conduct
What happened?
Deserializing any GitHub API response whose account
typeis"enterprise"throws anArgumentException. This affects enterprise-owned GitHub Apps, which became generally available on 2025-03-10 and returnowner.type = "enterprise"from endpoints such asGET /app.The
AccountTypeenum (Octokit/Models/Response/AccountType.cs) only definesUser,Organization,Bot, andMannequin.Account.Typeis a rawAccountType?rather than aStringEnum<AccountType>, soSimpleJsonSerializercallsEnum.Parse(..., "enterprise", ...)and throws for the unknown value.Versions
Octokit.NET 14.0.0
Relevant log output
System.ArgumentException: Requested value 'enterprise' was not found. at System.Enum.TryParseByName(...) at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase) at Octokit.Internal.SimpleJsonSerializer.GitHubSerializerStrategy.DeserializeEnumHelper(String value, Type type) at Octokit.Internal.SimpleJsonSerializer.Deserialize[T](String json)Notes
Same root cause as #2998 (reported for CheckRunEventPayload); PR #2999 proposed adding the enum member but was auto-closed by the stale bot without merging. This issue tracks the same missing Enterprise account type.
Code of Conduct