Skip to content

Commit

Permalink
Unescape slahes in Inspect.dump
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Mar 19, 2021
1 parent 5b4b7ac commit 3a6373f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Sources/ServiceStack/Inspect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ public class Inspect {
encoder.outputFormatting = .prettyPrinted
if let data = try? encoder.encode(obj) {
let json = String(data: data, encoding: .utf8)!
return json.replacingOccurrences(of:"\"", with: "")
return json
.replacingOccurrences(of:"\"", with: "")
.replacingOccurrences(of:"\\/", with: "/")
} else {
var toStr = String()
Swift.dump(obj, to:&toStr)
Expand Down
3 changes: 2 additions & 1 deletion Tests/ServiceStackTests/AutoQueryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class AutoQueryTests: XCTestCase {

do {
let response = try client.get(request)


// Inspect.printDump(response)
XCTAssertEqual(response.total, 15)
XCTAssertEqual(response.results.count, 3)
let names = response.results.map { $0.name! }.joined(separator: ",")
Expand Down

0 comments on commit 3a6373f

Please sign in to comment.