Skip to content
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

Support for object deployment payloads #920

Merged
merged 2 commits into from
Aug 7, 2020
Merged

Support for object deployment payloads #920

merged 2 commits into from
Aug 7, 2020

Conversation

ewiegs4
Copy link
Contributor

@ewiegs4 ewiegs4 commented Aug 7, 2020

Description

Deployments contain a payload field that is described as:

JSON payload with extra information about the deployment.

This library's GHDeployment.getPayload() method always tries to cast the deserialized payload object into a String, which fails for any payload that is a JSON object (deserialized as a Map).

While a particularly elegant solution might be to allow specifying a custom Java type to deserialize the payload into, currently object payloads are completely inaccessible so I am proposing a minimal solution of allowing access to the payload as the raw Object or as a Map<String, Object>.

Before submitting a PR:

We love getting PRs, but we hate asking people for the same basic changes every time.

  • Push your changes to a branch other than master. Create your PR from that branch.
  • Add JavaDocs and other comments
  • Write tests that run and pass in CI. See CONTRIBUTING.md for details on how to capture snapshot data.
  • Run mvn clean compile locally. This may reformat your code, commit those changes.
  • Run mvn -D enable-ci clean install site locally. If this command doesn't succeed, your change will not pass CI.

When creating a PR:

  • Fill in the "Description" above.
  • Enable "Allow edits from maintainers".

Copy link
Member

@bitwiseman bitwiseman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a super elegant solution, but perfectly reasonable.

Sufficient tests.

Great! Thanks!

@bitwiseman bitwiseman merged commit 4f0d62f into hub4j:master Aug 7, 2020
@ewiegs4 ewiegs4 deleted the deployment-payload branch August 11, 2020 19:46
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

Successfully merging this pull request may close these issues.

2 participants