diff --git a/Project.toml b/Project.toml index 5f9eebaac..f86212236 100644 --- a/Project.toml +++ b/Project.toml @@ -29,7 +29,7 @@ Compat = "4.11" GitHub = "5" HTTP = "1" IniFile = "0.5" -JSON = "0.18, 0.19, 0.20, 0.21" +JSON = "0.18, 0.19, 0.20, 0.21, 1" MbedTLS = "0.6, 0.7, 1" Mocking = "0.7, 0.8" OrderedCollections = "1.3" diff --git a/README.md b/README.md index 63960240a..88a0fb9dd 100644 --- a/README.md +++ b/README.md @@ -203,4 +203,4 @@ As well as some hand-written packages for specific AWS services: * [AWSEC2.jl](https://github.com/samoconnor/AWSEC2.jl) - Julia 0.6 * [AWSLambda.jl](https://github.com/samoconnor/AWSLambda.jl) - Julia 0.6 * [AWSSES.jl](https://github.com/samoconnor/AWSSES.jl) - Julia 0.6 -* [AWSSDB.jl](https://github.com/samoconnor/AWSSDB.jl) - Julia 0.6 +* [AWSSDB.jl](https://github.com/samoconnor/AWSSDB.jl) - Julia 0.6 \ No newline at end of file diff --git a/src/AWS.jl b/src/AWS.jl index 1a7b00815..13a138c9d 100644 --- a/src/AWS.jl +++ b/src/AWS.jl @@ -5,6 +5,7 @@ using Base64 using Dates using Downloads: Downloads, Downloader, Curl using HTTP +using JSON: JSON using MbedTLS using Mocking using OrderedCollections: LittleDict, OrderedDict @@ -401,7 +402,7 @@ function (service::JSONService)( use_response_type=feature_set.use_response_type, resource=POST_RESOURCE, request_method="POST", - content=json(args), + content=JSON.json(args), url=generate_service_url(aws_config, service.endpoint_prefix, POST_RESOURCE), ) @@ -458,7 +459,7 @@ function (service::RestJSONService)( end request.headers["Content-Type"] = "application/json" - request.content = json(args) + request.content = JSON.json(args) return submit_request(aws_config, request; return_headers=return_headers) end diff --git a/src/AWSCredentials.jl b/src/AWSCredentials.jl index 033af0059..8d8177a68 100644 --- a/src/AWSCredentials.jl +++ b/src/AWSCredentials.jl @@ -1,7 +1,6 @@ using Dates using HTTP using IniFile -using JSON using Mocking using ..AWSExceptions @@ -232,12 +231,12 @@ function ec2_instance_credentials(profile::AbstractString) info = IMDS.get("/latest/meta-data/iam/info") info === nothing && return nothing - info = JSON.parse(info) + info = JSON.parse(info; dicttype=Dict) # Get credentials for the role associated to the instance via instance profile. name = IMDS.get("/latest/meta-data/iam/security-credentials/") creds = IMDS.get("/latest/meta-data/iam/security-credentials/$name") - parsed = JSON.parse(creds) + parsed = JSON.parse(creds; dicttype=Dict) instance_profile_creds = AWSCredentials( parsed["AccessKeyId"], parsed["SecretAccessKey"], @@ -332,7 +331,7 @@ function ecs_instance_credentials() rethrow() end new_creds = String(response.body) - new_creds = JSON.parse(new_creds) + new_creds = JSON.parse(new_creds; dicttype=Dict) expiry = DateTime(rstrip(new_creds["Expiration"], 'Z')) diff --git a/src/AWSExceptions.jl b/src/AWSExceptions.jl index 5551226dc..3087bb0bf 100644 --- a/src/AWSExceptions.jl +++ b/src/AWSExceptions.jl @@ -1,7 +1,7 @@ module AWSExceptions using HTTP -using JSON +using JSON: JSON using XMLDict using XMLDict: XMLDictElement @@ -87,12 +87,12 @@ function AWSException(e::HTTP.StatusError, body::AbstractString) if !isempty(body) # Extract API error code from Lambda-style JSON error message... if endswith(content_type, "json") - info = JSON.parse(body) + info = JSON.parse(body; dicttype=Dict) end # Extract API error code from JSON error message... if occursin(r"^application/x-amz-json-1\.[01]$", content_type) - info = JSON.parse(body) + info = JSON.parse(body; dicttype=Dict) if haskey(info, "__type") code = rsplit(info["__type"], '#'; limit=2)[end] end diff --git a/src/AWSMetadata.jl b/src/AWSMetadata.jl index 4878bbe22..c179fc758 100644 --- a/src/AWSMetadata.jl +++ b/src/AWSMetadata.jl @@ -4,7 +4,7 @@ using Base64 using ..AWSExceptions using GitHub using HTTP -using JSON +using JSON: JSON using Mocking using OrderedCollections: LittleDict, OrderedDict diff --git a/test/patch.jl b/test/patch.jl index 2e36d0406..1437c6246 100644 --- a/test/patch.jl +++ b/test/patch.jl @@ -4,7 +4,6 @@ using AWS using Dates using Downloads: Downloads using HTTP -using JSON using GitHub using Mocking using OrderedCollections: LittleDict diff --git a/test/resource/setup.jl b/test/resource/setup.jl index 479d6b315..37d4b66df 100755 --- a/test/resource/setup.jl +++ b/test/resource/setup.jl @@ -4,7 +4,7 @@ using AWS using AWS: AWSException -using JSON +using JSON: JSON @service CloudFormation use_response_type = true @service IAM use_response_type = true diff --git a/test/runtests.jl b/test/runtests.jl index 2b5172f36..ec223323b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -24,7 +24,7 @@ using Downloads using GitHub using HTTP using IniFile: Inifile, sections -using JSON +using JSON: JSON using OrderedCollections: LittleDict, OrderedDict using MbedTLS: digest, MD_SHA256, MD_MD5 using Mocking