Skip to content

Commit

Permalink
refactor: fixed linter
Browse files Browse the repository at this point in the history
  • Loading branch information
npwork committed Nov 24, 2021
1 parent e1519a2 commit 9b5bf9c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ data class GraphQLResponse(val json: String, val headers: Map<String, List<Strin
*/

val data: Map<String, Any> = parsed.read("data") ?: emptyMap()
val errors: List<GraphQLError> = parsed.read("errors", jsonTypeRef<List<GraphQLError>>() ) ?: emptyList()
val errors: List<GraphQLError> = parsed.read("errors", jsonTypeRef<List<GraphQLError>>()) ?: emptyList()

constructor(json: String) : this(json, emptyMap())

Expand Down Expand Up @@ -137,4 +137,4 @@ data class GraphQLResponse(val json: String, val headers: Map<String, List<Strin
@JsonIgnoreProperties(ignoreUnknown = true)
data class RequestDetails(val requestId: String?, val edgarLink: String?)

inline fun <reified T> jsonTypeRef(): TypeRef<T> = object: TypeRef<T>() {}
inline fun <reified T> jsonTypeRef(): TypeRef<T> = object : TypeRef<T>() {}

0 comments on commit 9b5bf9c

Please sign in to comment.