Skip to content

0.0.1 - Initial Release

Choose a tag to compare

@coenttb coenttb released this 26 Jul 10:44
· 72 commits to main since this release

Swift URL Form Coding 0.0.1

Type-safe Swift library for encoding and decoding application/x-www-form-urlencoded data using Swift's Codable protocol.

Features

  • Type-safe: Full Swift Codable support for form data
  • Multiple parsing strategies: Support for different form data formats (brackets, indices, accumulate values)
  • Comprehensive: Handles nested objects, arrays, dates, and custom data types
  • Standards compliant: RFC 3986 URL encoding
  • Zero dependencies: Pure Swift implementation
  • Swift 6.0 ready: Includes Swift 6.0 language mode support

Quick Start

import URLFormCoding

struct User: Codable {
    let name: String
    let age: Int
    let isActive: Bool
}

let encoder = URLFormEncoder()
let decoder = URLFormDecoder()

// Encode to form data
let user = User(name: "John Doe", age: 30, isActive: true)
let formData = try encoder.encode(user)
// Result: "name=John%20Doe&age=30&isActive=true"

// Decode from form data
let decoded = try decoder.decode(User.self, from: formData)

Package Integration

For URLRouting integration, see swift-url-routing.

Full Changelog: https://github.com/coenttb/swift-url-form-coding/commits/0.0.1