Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
[compat]
HTTP = "1.10.17" # Must be >= 1.10.17, see https://github.com/JuliaWeb/GitHub.jl/pull/225
URIs = "1.6" # Must be >= 1.6, see https://github.com/JuliaWeb/GitHub.jl/pull/225
JSON = "0.19, 0.20, 0.21"
JSON = "0.19, 0.20, 0.21, 1"
MbedTLS = "0.6, 0.7, 1"
SodiumSeal = "0.1"
julia = "1.6"
Expand Down
4 changes: 2 additions & 2 deletions src/activity/events.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

mutable struct WebhookEvent
kind::String
payload::Dict
payload::AbstractDict
repository::Repo
sender::Owner
end

function event_from_payload!(kind, data::Dict)
function event_from_payload!(kind, data::AbstractDict)
if haskey(data, "repository")
repository = Repo(data["repository"])
elseif kind == "membership" ||
Expand Down
2 changes: 1 addition & 1 deletion src/issues/reviews.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
state::Union{String, Nothing}
end

function Review(pr::PullRequest, data::Dict)
function Review(pr::PullRequest, data::AbstractDict)
rev = Review(data)
rev.pr = pr
rev
Expand Down
8 changes: 4 additions & 4 deletions src/utils/GitHubType.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ macro ghdef(expr)
quote
Base.@__doc__($(esc(expr)))
($(esc(T)))($params_ex) = ($(esc(T)))($(call_args...))
$(esc(T))(data::Dict) = json2github($T, data)
$(esc(T))(data::AbstractDict) = json2github($T, data)
end
end

Expand Down Expand Up @@ -87,7 +87,7 @@ function unwrap_union_types(T::Union)
return T.a
end

function extract_nullable(data::Dict, key, ::Type{T}) where {T}
function extract_nullable(data::AbstractDict, key, ::Type{T}) where {T}
if haskey(data, key)
val = data[key]
if val !== nothing
Expand Down Expand Up @@ -122,7 +122,7 @@ end
# dictionary into the type `G` with the expectation that the fieldnames of
# `G` are keys of `data`, and the corresponding values can be converted to the
# given field types.
@generated function json2github(::Type{G}, data::Dict) where {G<:GitHubType}
@generated function json2github(::Type{G}, data::AbstractDict) where {G<:GitHubType}
types = unwrap_union_types.(collect(G.types))
fields = fieldnames(G)
args = Vector{Expr}(undef, length(fields))
Expand Down Expand Up @@ -156,7 +156,7 @@ function github2json(g::GitHubType)
return results
end

function github2json(data::Dict{K}) where {K}
function github2json(data::AbstractDict{K}) where {K}
results = Dict{K,Any}()
for (key, val) in data
results[key] = github2json(val)
Expand Down