Repository navigation
1.2.0
Encodable Schema Conformance
The @Schema macro now auto-generates Encodable conformance, so schema types can be passed directly to JSONEncoder without manually constructing dictionaries.
// Before — manual mapping
return try conn.json(value: donuts.map { d in
["id": "\(d.id)", "name": d.name, "price": "\(d.price)"]
})
// After — direct encoding
return try conn.json(encodable: donuts)What's new
- Auto-generated
Encodable—CodingKeysenum andencode(to:)method generated at compile time for all@Schematypes - Snake_case JSON keys —
createdAt→"created_at", matching database column convention @Column("custom")overrides — custom column names are used as JSON keys- Smart relationship encoding —
@HasMany,@HasOne,@BelongsTo,@ManyToManyfields are included only when loaded; omitted entirely when.notLoaded - Opt-out —
@Schema("secrets", encodable: false)skipsEncodablegeneration
Fixes
- Fixed CLI tests for Noora styled output in non-interactive environments
- Fixed CI false positives from skipped tests being reported as failures
- Disabled two transaction tests that trigger Swift 6 SIGBUS (runtime bug, not Spectro bug)