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

supabase / supabase-swift / 29018885975

09 Jul 2026 12:40PM UTC coverage: 77.87% (-5.2%) from 83.062%
29018885975

Pull #1099

github

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

428 of 1233 new or added lines in 18 files covered. (34.71%)

6 existing lines in 2 files now uncovered.

8322 of 10687 relevant lines covered (77.87%)

33.72 hits per line

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

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

9
/// A free-form JSON value, used for spec `document` / `Record<unknown>` types.
10
package enum JSONValue: Codable, Sendable, Hashable {
11
  case null
12
  case bool(Bool)
13
  case number(Double)
14
  case string(String)
15
  case array([JSONValue])
16
  case object([String: JSONValue])
17

18
  package init(from decoder: any Decoder) throws {
7✔
19
    let container = try decoder.singleValueContainer()
7✔
20
    if container.decodeNil() {
7✔
21
      self = .null
1✔
22
    } else if let value = try? container.decode(Bool.self) {
1✔
23
      self = .bool(value)
1✔
24
    } else if let value = try? container.decode(Double.self) {
2✔
25
      self = .number(value)
2✔
26
    } else if let value = try? container.decode(String.self) {
2✔
27
      self = .string(value)
1✔
28
    } else if let value = try? container.decode([JSONValue].self) {
1✔
29
      self = .array(value)
1✔
30
    } else if let value = try? container.decode([String: JSONValue].self) {
1✔
31
      self = .object(value)
1✔
32
    } else {
1✔
NEW
33
      throw DecodingError.dataCorruptedError(
×
NEW
34
        in: container,
×
NEW
35
        debugDescription: "Unsupported JSON value"
×
NEW
36
      )
×
37
    }
7✔
38
  }
7✔
39

40
  package func encode(to encoder: any Encoder) throws {
7✔
41
    var container = encoder.singleValueContainer()
7✔
42
    switch self {
7✔
43
    case .null: try container.encodeNil()
7✔
44
    case .bool(let value): try container.encode(value)
7✔
45
    case .number(let value): try container.encode(value)
7✔
46
    case .string(let value): try container.encode(value)
7✔
47
    case .array(let value): try container.encode(value)
7✔
48
    case .object(let value): try container.encode(value)
7✔
49
    }
7✔
50
  }
7✔
51
}
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