mirror of
https://github.com/apple/swift-http-structured-headers
synced 2026-11-24 04:37:50 +00:00
Motivation: Right now we disambiguate the multiple top-level SH types by using three separate entry points on the encoder/decoder. This isn't great: it forces that information to be known statically at compile time, making it much harder to write generic APIs that use structured header fields. Modifications: - Provide a new protocol, `StructuredHeaderField`, that must be used for the top-level `Codable` object. - Provide `StructuredHeaderFieldType` to communicate the types of structured header fields. - Remove the multiple entry points. - Update the tests. Result: Types will encode what kind of structured header field they are.