Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,29 @@ on:
branches: [ main ]

jobs:
macos-build:

runs-on: macos-latest
SwiftLang:
strategy:
fail-fast: false
matrix:
os: [macOS-15, ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Build (macOS)
run: swift build -v
- name: Run tests
run: swift test -v

ubuntu-build:

runs-on: ubuntu-latest
- name: Checkout
uses: actions/checkout@v4

steps:
- uses: actions/checkout@v2
- name: Build (Ubuntu)
run: swift build -v
- name: Run tests
run: swift test -v
- name: Package Resolution
shell: bash
run: swift package resolve

- name: Build
shell: bash
run: swift build

- name: Test
shell: bash
run: swift test

4 changes: 4 additions & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: 1
builder:
configs:
- documentation_targets: [CodablePlus]
11 changes: 6 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
// swift-tools-version:5.1
// swift-tools-version:5.8
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "CodablePlus",
platforms: [
.macOS(.v10_12),
.iOS(.v10),
.tvOS(.v10),
.watchOS(.v3),
.macOS(.v12),
.macCatalyst(.v15),
.iOS(.v15),
.tvOS(.v15),
.watchOS(.v8)
],
products: [
.library(
Expand Down
55 changes: 24 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,9 @@
<p align="center">
<img src="Resources/CodablePlus.png" width="1000" max-width="90%" alt="CodablePlus" />
</p>
<img src="Resources/CodablePlus.png" width="1000" max-width="90%" alt="CodablePlus" />

<p align="center">
<img src="https://github.com/richardpiazza/CodablePlus/workflows/Swift/badge.svg?branch=main" />
<img src="https://img.shields.io/badge/Swift-5.1-orange.svg" />
<a href="https://twitter.com/richardpiazza">
<img src="https://img.shields.io/badge/twitter-@richardpiazza-blue.svg?style=flat" alt="Twitter: @richardpiazza" />
</a>
</p>
A collection of extensions around the Swift `Codable` implementation.

<p align="center">A collection of extensions around the Swift <code>Codable</code> implementation.</p>

## Installation

**Codable+** is distributed using the [Swift Package Manager](https://swift.org/package-manager). To install it into a project, add it as a dependency within your `Package.swift` manifest:

```swift
let package = Package(
...
dependencies: [
.package(url: "https://github.com/richardpiazza/CodablePlus.git", from: "0.3.0")
],
...
)
```

Then import **Codable+** wherever you'd like to use it:

```swift
import CodablePlus
```
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Frichardpiazza%2FCodablePlus%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/richardpiazza/CodablePlus)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Frichardpiazza%2FCodablePlus%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/richardpiazza/CodablePlus)

## Usage

Expand Down Expand Up @@ -148,6 +121,26 @@ let schema2json = """

Notice the `companyName =` in the `init(from:)` method? This specifies multiple `CodingKey`s as possibilities. Now our `CompanyV2` model supports decoding of our `CompanyV1` schema.

## Installation

**Codable+** is distributed using the [Swift Package Manager](https://swift.org/package-manager). To install it into a project, add it as a dependency within your `Package.swift` manifest:

```swift
let package = Package(
...
dependencies: [
.package(url: "https://github.com/richardpiazza/CodablePlus.git", from: "1.0.0")
],
...
)
```

Then import **Codable+** wherever you'd like to use it:

```swift
import CodablePlus
```

## Inspiration

**Codable+** has grown and been inspired by several posts around the interwebs:
Expand Down
Loading