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
GHUser even when event comes from Organization type #1497
Comments
I checked the public class GHAppInstallation extends GHObject {
private GHUser account;
<...>
/**
* Gets account.
*
* @return the account
*/
@SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior")
public GHUser getAccount() {
return account;
} As this is Jackson binding, I don't think we can do a simple |
Probably a similar problem to #126 .
We don't want to deserialize aa Jackson has functionality to allow you to switch types based on a field, but I've never used it. The SO answer below has an example of how to do this. |
You're completely right. Hmm I may have a look at it. Thanks @bitwiseman! |
Describe the bug
A
GHUser
type is returned even when in the payload the account type isOrganization
.More precisely in the event
installation.created
when theinstallation.account.type
is set toOrganization
(app installed in organization) theinstallation.account
in the@Installation.Created
payload returns aGHUser
.Also tried to use the
installationPayload.organization
object but it always returned null (probably it's used in other events):To Reproduce
Steps to reproduce the behavior:
installation.created
in an organization (install app in an organization)installationPayload.installation.account
objectinstallationPayload.organization
objectExpected behavior
If the payload has the
installation.account.type
set toOrganization
theinstallationPayload.installation.account
should return a GHOrganization object or theinstallationPayload.organization
should not return null.Desktop (please complete the following information):
Additional context
Using Kotlin and Quarkus GitHub App
The text was updated successfully, but these errors were encountered: