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

remove dependency on yasson from client #2095

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions client/implementation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>mutiny</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.smallrye.graphql.client.impl;

import java.io.StringReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
Expand All @@ -8,13 +9,10 @@
import jakarta.json.JsonBuilderFactory;
import jakarta.json.JsonObject;
import jakarta.json.JsonObjectBuilder;
import jakarta.json.JsonStructure;
import jakarta.json.JsonValue;
import jakarta.json.bind.Jsonb;
import jakarta.json.bind.JsonbBuilder;

import org.eclipse.yasson.internal.JsonBinding;

import io.smallrye.graphql.client.Request;

public class RequestImpl implements Request {
Expand Down Expand Up @@ -73,9 +71,9 @@ private JsonObject _formatJsonVariables() {
varBuilder.addNull(k);
} else {
try (Jsonb jsonb = JsonbBuilder.create()) {
JsonStructure struct = ((JsonBinding) jsonb).toJsonStructure(v);
varBuilder.add(k, struct);
} catch (Exception ignore) {
varBuilder.add(k, Json.createReader(new StringReader(jsonb.toJson(v))).read());
} catch (Exception e) {
throw new RuntimeException("Error converting variable to JSON", e);
}
}
});
Expand Down
Loading