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

Invalid Recipient JSON serialization #21

Open
KaseiFR opened this issue May 3, 2019 · 0 comments
Open

Invalid Recipient JSON serialization #21

KaseiFR opened this issue May 3, 2019 · 0 comments

Comments

@KaseiFR
Copy link

KaseiFR commented May 3, 2019

The JSON serialization of Recipient contains the field type two times, and is rejected by the OpsGenie API.

Here's an example:

  @Test
  public void test1() throws Exception {
    OpsGenieClient client = new OpsGenieClient();
    ObjectMapper om = client.alertV2().getApiClient().getObjectMapper();

    Recipient r = new Recipient().type(Recipient.TypeEnum.TEAM).id("voltron");

    String json = om.writeValueAsString(r);
    System.out.println(json);
    assert json.equals("{\"type\":\"Recipient\",\"type\":\"team\",\"id\":\"voltron\"}");
  }

I've tested it with an empty project importing only com.opsgenie.integration:sdk:2.11.2 and junit, so I don't think it comes from a Jackson version conflict.

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

1 participant