Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
swift-urlqueryitem-coder Sources URLQueryItemCoder Encoder Generic Implementation Strategies ArrayEncodingStrategy.swift
1.1 kB · 31 lines
Swift
at main
1234567891011121314151617181920212223242526272829303132//// ArrayEncodingStrategy.swift// URLQueryItemCoder//
/// The strategy to use for encoding `Array` values.public enum ArrayEncodingStrategy: Sendable { /// An array encoding strategy that encodes arrays as indexed keys. /// /// Each element is encoded under a key suffixed with its zero-based index, separated by a dot. /// For example, an array `["a", "b"]` at key `"tags"` produces `tags.0=a&tags.1=b`. /// /// The `ArrayEncodingStrategy.indexed` strategy is the strategy used if you don't specify one. case indexed
/// An array encoding strategy that encodes arrays as repeated keys. /// /// Each element is encoded under the same key. For example, an array `["a", "b"]` at key `"tags"` /// produces `tags=a&tags=b`. /// /// This is required by protocols such as XRPC (AT Protocol) which expect repeated query parameters /// for array values. case repeated
// MARK: Public Static Interface
/// The default array encoding strategy. /// /// Equals `.indexed`. public static let `default`: ArrayEncodingStrategy = .indexed}