Skip to content

Commit

Permalink
Merge pull request #136 from swift-aws/changeSwiftyJson
Browse files Browse the repository at this point in the history
use swiftyJson from swiftyJson instead of IBM
  • Loading branch information
jonnymacs committed Jun 17, 2019
2 parents c6d6d29 + 13af8c3 commit 29a2699
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Package.resolved
Expand Up @@ -66,11 +66,11 @@
},
{
"package": "SwiftyJSON",
"repositoryURL": "https://github.com/IBM-Swift/SwiftyJSON.git",
"repositoryURL": "https://github.com/SwiftyJSON/SwiftyJSON.git",
"state": {
"branch": null,
"revision": "f2612ea3ac29996ae9601bdcb00cc1c29e26f104",
"version": "17.0.4"
"revision": "2b6054efa051565954e1d2b9da831680026cd768",
"version": "4.3.0"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Expand Up @@ -177,7 +177,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/swift-aws/aws-sdk-swift-core.git", .upToNextMinor(from: "3.0.1")),
.package(url: "https://github.com/IBM-Swift/SwiftyJSON.git", .upToNextMajor(from: "17.0.2"))
.package(url: "https://github.com/SwiftyJSON/SwiftyJSON.git", .upToNextMajor(from: "4.1.0"))
],
targets: [
.target(name: "CodeGenerator", dependencies: ["AWSSDKSwiftCore", "SwiftyJSON"]),
Expand Down
8 changes: 4 additions & 4 deletions Sources/CodeGenerator/Util.swift
Expand Up @@ -29,7 +29,7 @@ func rootPath() -> String {

func loadEndpointJSON() throws -> JSON {
let data = try Data(contentsOf: URL(string: "file://\(rootPath())/models/endpoints/endpoints.json")!)
return JSON(data: data)
return try JSON(data: data)
}

func loadDocJSONList() throws -> [JSON] {
Expand All @@ -42,7 +42,7 @@ func loadDocJSONList() throws -> [JSON] {

return try docPaths.map {
let data = try Data(contentsOf: URL(string: "file://\($0)")!)
return JSON(data: data)
return try JSON(data: data)
}
}

Expand All @@ -56,7 +56,7 @@ func loadAPIJSONList() throws -> [JSON] {

return try apiPaths.map {
let data = try Data(contentsOf: URL(string: "file://\($0)")!)
var json = JSON(data: data)
var json = try JSON(data: data)
json["serviceName"].stringValue = serviceNameForApi(apiJSON: json)
return json
}
Expand All @@ -78,7 +78,7 @@ let serviceAliases: [String:String] = [
func serviceNameForApi(apiJSON: JSON) -> String {
var serviceNameJSON = apiJSON["metadata"]["serviceAbbreviation"]

if serviceNameJSON == nil {
if serviceNameJSON == JSON.null {
serviceNameJSON = apiJSON["metadata"]["serviceFullName"]
}

Expand Down

0 comments on commit 29a2699

Please sign in to comment.