this repo has no description
at main 31 lines 1.1 kB view raw
1// 2// ArrayEncodingStrategy.swift 3// URLQueryItemCoder 4// 5 6/// The strategy to use for encoding `Array` values. 7public enum ArrayEncodingStrategy: Sendable { 8 /// An array encoding strategy that encodes arrays as indexed keys. 9 /// 10 /// Each element is encoded under a key suffixed with its zero-based index, separated by a dot. 11 /// For example, an array `["a", "b"]` at key `"tags"` produces `tags.0=a&tags.1=b`. 12 /// 13 /// The `ArrayEncodingStrategy.indexed` strategy is the strategy used if you don't specify one. 14 case indexed 15 16 /// An array encoding strategy that encodes arrays as repeated keys. 17 /// 18 /// Each element is encoded under the same key. For example, an array `["a", "b"]` at key `"tags"` 19 /// produces `tags=a&tags=b`. 20 /// 21 /// This is required by protocols such as XRPC (AT Protocol) which expect repeated query parameters 22 /// for array values. 23 case repeated 24 25 // MARK: Public Static Interface 26 27 /// The default array encoding strategy. 28 /// 29 /// Equals `.indexed`. 30 public static let `default`: ArrayEncodingStrategy = .indexed 31}