Latest 0.8.3
Homepage https://github.com/NSSimpleApps/NSKJSON
License MIT
Platforms ios 8.0, osx 10.10, watchos 2.0, tvos 9.0, requires ARC
Authors

NSKJSON is a Swift library for parsing plain-json format and json5 format.

Installation: place this into Podfile

use_frameworks!
target 'Target' do
    pod 'NSKJSON'
end

Usage:

import NSKJSON

let data = // some data...
do {
    let plainJson = try NSKJSON.jsonObject(with: data, version: .plain)
    let json5 = try NSKJSON.jsonObject(with: data, version: .json5)
} catch {
    print(error)
}

let string = // some string...
do {
    let plainJson = try NSKJSON.jsonObject(fromString: string, version: .plain)
    let json5 = try NSKJSON.jsonObject(fromString: string, version: .json5)
} catch {
    print(error)
}

Test cases were taken from here:

https://github.com/nst/JSONTestSuite

https://github.com/json5/json5-tests

TODO:

  1. Improve error reports.
  2. Json encoding and decoding.
  3. Json validation.

Latest podspec

{
    "name": "NSKJSON",
    "version": "0.8.3",
    "summary": "NSKJSON is a swift library for parsing plain-json format and json5 format.",
    "homepage": "https://github.com/NSSimpleApps/NSKJSON",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "NSSimpleApps, Sergey Poluyanov": "[email protected]"
    },
    "source": {
        "git": "https://github.com/NSSimpleApps/NSKJSON.git",
        "tag": "0.8.3"
    },
    "requires_arc": true,
    "swift_version": "5.0",
    "platforms": {
        "ios": "8.0",
        "osx": "10.10",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "source_files": "Source/Swift/*.swift"
}

Pin It on Pinterest

Share This