CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

NSKJSON 1.4

NSKJSON 1.4

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Apr 2025
SPMSupports SPM

Maintained by Sergey Poluyanov.



  • By
  • NSSimpleApps, Sergey Poluyanov

NSKJSON

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.