• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supabase-swift / 29009119306

09 Jul 2026 09:42AM UTC coverage: 77.235% (-5.8%) from 83.062%
29009119306

Pull #1099

github

web-flow
Merge 78facb76f into 27f31bfb7
Pull Request #1099: feat(storage): OpenAPI codegen tool + generated Storage HTTP client

314 of 1121 new or added lines in 13 files covered. (28.01%)

52 existing lines in 2 files now uncovered.

8180 of 10591 relevant lines covered (77.24%)

33.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/Sources/HTTPRuntime/JSONCoding.swift
1
//
2
//  JSONCoding.swift
3
//  HTTPRuntime
4
//
5
//  Created by Guilherme Souza on 08/07/26.
6
//
7
package import Foundation
8

9
/// Shared JSON coders used by generated code. Dates are ISO-8601 with
10
/// fractional seconds, matching the mock server and the spec timestamps.
11
package enum JSONCoding {
12
  package static let encoder: JSONEncoder = {
1✔
13
    let encoder = JSONEncoder()
1✔
14
    encoder.dateEncodingStrategy = .custom { date, enc in
1✔
15
      var container = enc.singleValueContainer()
1✔
16
      try container.encode(iso8601.string(from: date))
1✔
17
    }
1✔
18
    return encoder
1✔
19
  }()
1✔
20

21
  package static let decoder: JSONDecoder = {
2✔
22
    let decoder = JSONDecoder()
2✔
23
    decoder.dateDecodingStrategy = .custom { dec in
2✔
24
      let container = try dec.singleValueContainer()
2✔
25
      let string = try container.decode(String.self)
2✔
26
      guard let date = iso8601.date(from: string) ?? iso8601NoFraction.date(from: string) else {
2✔
NEW
27
        throw DecodingError.dataCorruptedError(
×
NEW
28
          in: container,
×
NEW
29
          debugDescription: "Invalid ISO-8601 date: \(string)"
×
NEW
30
        )
×
31
      }
2✔
32
      return date
2✔
33
    }
2✔
34
    return decoder
2✔
35
  }()
2✔
36

37
  /// ISO-8601 string with fractional seconds, for `@httpQuery` timestamp params.
NEW
38
  package static func iso8601String(_ date: Date) -> String {
×
NEW
39
    iso8601.string(from: date)
×
NEW
40
  }
×
41

42
  nonisolated(unsafe) private static let iso8601: ISO8601DateFormatter = {
1✔
43
    let formatter = ISO8601DateFormatter()
1✔
44
    formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
1✔
45
    return formatter
1✔
46
  }()
1✔
47

NEW
48
  nonisolated(unsafe) private static let iso8601NoFraction: ISO8601DateFormatter = {
×
NEW
49
    let formatter = ISO8601DateFormatter()
×
NEW
50
    formatter.formatOptions = [.withInternetDateTime]
×
NEW
51
    return formatter
×
NEW
52
  }()
×
53
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc