Search in sources :

Example 1 with JsonUtils

use of io.smallrye.graphql.client.impl.typesafe.json.JsonUtils in project smallrye-graphql by smallrye.

the class ResultBuilder method getPath.

private static List<Object> getPath(JsonValue jsonValue) {
    JsonValue value = jsonValue.asJsonObject().get("path");
    JsonArray jsonArray;
    if (value != null && value.getValueType().equals(JsonValue.ValueType.ARRAY)) {
        jsonArray = value.asJsonArray();
    } else {
        jsonArray = null;
    }
    return (jsonArray == null) ? null : jsonArray.stream().map(JsonUtils::toValue).collect(Collectors.toList());
}
Also used : JsonCollectors.toJsonArray(javax.json.stream.JsonCollectors.toJsonArray) JsonArray(javax.json.JsonArray) JsonUtils(io.smallrye.graphql.client.impl.typesafe.json.JsonUtils) JsonValue(javax.json.JsonValue)

Aggregations

JsonUtils (io.smallrye.graphql.client.impl.typesafe.json.JsonUtils)1 JsonArray (javax.json.JsonArray)1 JsonValue (javax.json.JsonValue)1 JsonCollectors.toJsonArray (javax.json.stream.JsonCollectors.toJsonArray)1