Skip to content

abegehr/json-apple

This branch is 2 commits behind shareup/json-apple:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

73b2096 · Oct 27, 2023

History

11 Commits
Oct 27, 2023
Oct 27, 2023
Oct 27, 2023
Oct 27, 2023
Sep 23, 2022
Oct 27, 2023
Mar 19, 2023
Sep 23, 2022
Oct 27, 2023
Oct 27, 2023

Repository files navigation

JSON

JSON is a simple, type-safe JSON type implemented in pure Swift. It's intended to be lightweight and ergonomic. Most especially, it can be used in model value types that need to be sendable.

Usage

let json: JSON = [
    "one": 2,
    "two_text": "two",
    "pi": 3.14,
    "yes": true,
    "null": nil,
    "object": [
        "three": 3,
        "four_text": "four",
        "null": nil,
        "inner_array": [
            "index_0",
            false,
            4.20,
        ] as [Any?],
    ] as [String: Any?],
]

json["one"].integerValue // 2
json["object"]["four_text"].stringValue // "four"

Installation

Swift Package Manager

To use JSON with the Swift Package Manager, add a dependency to your Package.swift file:

let package = Package(
   dependencies: [
       .package(
           url: "https://github.com/shareup/json-apple.git", 
           from: "1.4.0"
       )
   ]
)

License

The license for JSON is the standard MIT licence. You can find it in the LICENSE file.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 98.6%
  • Shell 1.4%