This framework implements a strict JSON parser and generator in Objective-C.

Overview

SBJson 5

Chunk-based JSON parsing and generation in Objective-C.

CircleCI Project Status: Inactive - The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows. Carthage compatible

Overview

SBJson's number one feature is stream/chunk-based operation. Feed the parser one or more chunks of UTF8-encoded data and it will call a block you provide with each root-level document or array. Or, optionally, for each top-level entry in each root-level array.

With this you can reduce the apparent latency for each download/parse cycle of documents over a slow connection. You can start parsing and return chunks of the parsed document before the full document has downloaded. You can also parse massive documents bit by bit so you don't have to keep them all in memory.

SBJson maps JSON types to Objective-C types in the following way:

JSON Type Objective-C Type
null NSNull
string NSString
array NSMutableArray
object NSMutableDictionary
true -[NSNumber numberWithBool: YES]
false -[NSNumber numberWithBool: NO]
number NSNumber
  • Booleans roundtrip properly even though Objective-C doesn't have a dedicated class for boolean values.
  • Integers use either long long or unsigned long long if they fit, to avoid rounding errors. For all other numbers we use the double type, with all the potential rounding errors that entails.

"Plain" Chunk Based Parsing

First define a simple block & an error handler. (These are just minimal examples. You should strive to do something better that makes sense in your application!)

SBJson5ValueBlock block = ^(id v, BOOL *stop) {
    BOOL isArray = [v isKindOfClass:[NSArray class]];
    NSLog(@"Found: %@", isArray ? @"Array" : @"Object");
};

SBJson5ErrorBlock eh = ^(NSError* err) {
    NSLog(@"OOPS: %@", err);
    exit(1);
};

Then create a parser and add data to it:

id parser = [SBJson5Parser parserWithBlock:block
                              errorHandler:eh];

id data = [@"[true," dataWithEncoding:NSUTF8StringEncoding];
[parser parse:data]; // returns SBJson5ParserWaitingForData

// block is not called yet...

// ok, now we add another value and close the array

data = [@"false]" dataWithEncoding:NSUTF8StringEncoding];
[parser parse:data]; // returns SBJson5ParserComplete

// the above -parse: method calls your block before returning.

Alright! Now let's look at something slightly more interesting.

Handling multiple documents

This is useful for something like Twitter's feed, which gives you one JSON document per line. Here is an example of parsing many consequtive JSON documents, where your block will be called once for each document:

id parser = [SBJson5Parser multiRootParserWithBlock:block
                                       errorHandler:eh];

// Note that this input contains multiple top-level JSON documents
id data = [@"[]{}" dataWithEncoding:NSUTF8StringEncoding];
[parser parse:data];
[parser parse:data];

The above example will print:

Found: Array
Found: Object
Found: Array
Found: Object

Unwrapping a gigantic top-level array

Often you won't have control over the input you're parsing, so can't use a multiRootParser. But, all is not lost: if you are parsing a long array you can get the same effect by using an unwrapRootArrayParser:

id parser = [SBJson5Parser unwrapRootArrayParserWithBlock:block
                                             errorHandler:eh];

// Note that this input contains A SINGLE top-level document
id data = [@"[[],{},[],{}]" dataWithEncoding:NSUTF8StringEncoding];
[parser parse:data];

Other features

  • For safety there is a max nesting level for all input. This defaults to 32, but is configurable.
  • The writer can sort dictionary keys so output is consistent across writes.
  • The writer can create human-readable output, with newlines and indents.
  • You can install SBJson v3, v4 and v5 side-by-side in the same application. (This is possible because all classes & public symbols contains the major version number.)

A word of warning

Stream based parsing does mean that you lose some of the correctness verification you would have with a parser that considered the entire input before returning an answer. It is technically possible to have some parts of a document returned as if they were correct but then encounter an error in a later part of the document. You should keep this in mind when considering whether it would suit your application.

American Fuzzy Lop

I've run AFL on the sbjson binary for over 24 hours, with no crashes found. (I cannot reproduce the hangs reported when attempting to parse them manually.)

                       american fuzzy lop 2.35b (sbjson)

┌─ process timing ─────────────────────────────────────┬─ overall results ─────┐
│        run time : 1 days, 0 hrs, 45 min, 26 sec      │  cycles done : 2      │
│   last new path : 0 days, 0 hrs, 5 min, 24 sec       │  total paths : 555    │
│ last uniq crash : none seen yet                      │ uniq crashes : 0      │
│  last uniq hang : 0 days, 2 hrs, 11 min, 43 sec      │   uniq hangs : 19     │
├─ cycle progress ────────────────────┬─ map coverage ─┴───────────────────────┤
│  now processing : 250* (45.05%)     │    map density : 0.70% / 1.77%         │
│ paths timed out : 0 (0.00%)         │ count coverage : 3.40 bits/tuple       │
├─ stage progress ────────────────────┼─ findings in depth ────────────────────┤
│  now trying : auto extras (over)    │ favored paths : 99 (17.84%)            │
│ stage execs : 603/35.6k (1.70%)     │  new edges on : 116 (20.90%)           │
│ total execs : 20.4M                 │ total crashes : 0 (0 unique)           │
│  exec speed : 481.9/sec             │   total hangs : 44 (19 unique)         │
├─ fuzzing strategy yields ───────────┴───────────────┬─ path geometry ────────┤
│   bit flips : 320/900k, 58/900k, 5/899k             │    levels : 8          │
│  byte flips : 0/112k, 4/112k, 3/112k                │   pending : 385        │
│ arithmetics : 66/6.24M, 0/412k, 0/35                │  pend fav : 1          │
│  known ints : 5/544k, 0/3.08M, 0/4.93M              │ own finds : 554        │
│  dictionary : 0/0, 0/0, 29/1.83M                    │  imported : n/a        │
│       havoc : 64/300k, 0/0                          │ stability : 100.00%    │
│        trim : 45.19%/56.5k, 0.00%                   ├────────────────────────┘
^C────────────────────────────────────────────────────┘             [cpu: 74%]

+++ Testing aborted by user +++
[+] We're done here. Have a nice day!

API Documentation

Please see the API Documentation for more details.

Installation

CocoaPods

The preferred way to use SBJson is by using CocoaPods. In your Podfile use:

pod 'SBJson', '~> 5.0.0'

Carthage

SBJson is compatible with Carthage. Follow the Getting Started Guide for iOS.

github "SBJson/SBJson" == 5.0.2

Bundle the source files

An alternative that I no longer recommend is to copy all the source files (the contents of the Classes folder) into your own Xcode project.

Examples

Support

  • Review (or create) StackOverflow questions tagged with SBJson if you have questions about how to use the library.
  • Use the issue tracker if you have found a bug.
  • I regret I'm only able to support the current major release.

Philosophy on backwards compatibility

SBJson practice Semantic Versioning, which means we do not break the API in major releases. If something requires a backwards-incompatible change, we release a new major version. (Hence why a library of less than 1k lines has more major versions than Emacs.)

I also try support a gradual migration from one major version to the other by allowing the last three major versions to co-exist in the same app without conflicts. The way to do this is putting the major version number in all the library's symbols and file names. So if v6 ever comes out, the SBJson5Parser class would become SBJson6Parser, etc.

License

BSD. See LICENSE for details.

Comments
  • Add iOS Framework target

    Add iOS Framework target

    As mentioned in #202, this is more or less the MVP version of adding Carthage compatibility.

    • [x] Add a SBJson-iOS target
    • [x] Make the Mac and iOS target more similar

    I've confirmed that the project still validates by pulling in the podspec and running pod lib lint SBJson.podspec.json locally.

    Note that while the targets are called SBJson-Mac and SBJson-iOS, the resulting frameworks are both called SBJson.framework.

    Optionally, we could remove the static library target, as CocoaPods will create a new one regardless, this would also allow simplifying the project structure (i.e. moving files from src/main to SBJson and from src/test to SBJsonTests which is how Xcode would set up a new project). Let me know how you'd like it done.

    It also may make sense to run carthage build --no-skip-current as part of CI to make sure the project remains Carthage compatible in the future.

    Fixes #202

    Enhancement 
    opened by robb 22
  • reported memory leak

    reported memory leak

    Reposted from Issue 13 on google code:

    I get a memory leak in OS 4.02 when requesting data more than once in a screen (with button) and parsing it with JSONValue, but not the first time.

    NSError *error;
    NSURLResponse *response;
    NSData *dataReply;
    
    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://company.xxx.com/tabweb?get=Ligensuche&put=Suchwert:%@", searchBar.text]];
    
    
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    dataReply = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
    
    NSString *responseString = [[NSString alloc] initWithData:dataReply encoding:NSUTF8StringEncoding];
    
    NSDictionary *results = [responseString JSONValue]; <-- Hier leak occurs
    if (results)
    {
        tableData = [[NSArray alloc] initWithArray:[results objectForKey:@"data"]];
    }
    [responseString release];
    responseString = nil;
    
    [self.tableView reloadData];
    
    Not a Bug 
    opened by stig 21
  • Unicode escape sequences

    Unicode escape sequences

    Great work apart from one little issue: when using the framework I recognized that unicode escape sequences are not unescaped properly, or did I miss out on something there, like calling a special method that would do that?

    Unable to Reproduce 
    opened by fluecke 17
  • Support full range of `double`

    Support full range of `double`

    (via @trevyn on issue #127)

    Currently SBJson uses NSDecimalNumber for all floating-point numbers and integers of more than 19 digits. NSDecimalNumber has 38 digits of precision, but at the cost of supporting a smaller range than double. While double only supports ~17 digits of precision it supports exponents up to 308, compared to NSDecimalNumber's 127.

    I'm currently torn between:

    1. Changing to use NSNumber (i.e. a double) for floating point numbers. This would support larger/smaller values than now, at the cost of lower precision.
    2. Try to intelligently use either double or NSDecimalNumber based on the length of the mantissa and/or exponent.

    I suspect that 1) would be more in line with what people expect, particularly since JavaScript uses double as its underlying datatype.

    Enhancement 
    opened by stig 16
  • Restore non-ARC compatibility

    Restore non-ARC compatibility

    ARC is great, but not everyone can use it!

    We are currently developing a Mac application, and we cannot use ARC because we need the application to be universal (32 bit and 64 bit). MANY users are still on Snow Leopard, and we cannot ignore them, making a Lion-only application. 3 months ago, for example, because of an human error, we accidentally removed Snow Leopard support with an update: in the 20 days when the app was Lion-only, sales sank and we had -30% profits from Mac App Store for that month (March) compared to the one before.

    Using conditional-comments it's relatively easy to target non-ARC systems. I really think you should re-consider supporting non-ARC systems somehow.

    Rejected 
    opened by ItalyPaleAle 15
  • Framework not in DMG

    Framework not in DMG

    Hey all,

    Just an FYI the framework, nor any of the files required to build the framework are included with the latest 2.3 DMG, I am not sure if this was deliberate but its very confusing to me that the source is only the .h and .m files and not the actual XCode project you would use to build the framework too?

    Bug 
    opened by unknowndomain 11
  • Incorrectly Parsed Unicode Characters

    Incorrectly Parsed Unicode Characters

    I've got an odd problem where SBJson is incorrectly parsing a unicode character in a string. The character should be \u2013 but SBJson is returning three unicode characters: \U201a \U00c4 \U00ec.

    Here is the code I am using to do the parsing in a test project:

    NSString *filePath = @"/Users/simon/Desktop/RawQuote.txt";
    NSData *jsonData = [NSData dataWithContentsOfFile:filePath];
    
    SBJsonParser *json = [SBJsonParser new];
    id o = [json objectWithData:jsonData];
    if (!o)
    {
        NSLog(@"%@", [json error]);
        return 0;
    }
    else
    {
        NSLog(@"%@", o);
    }
    
    NSLog(@"---");
    
    NSError *error;
    id j = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&error];
    NSLog(@"%@", j);
    

    And here is the UTF-8 text I'm parsing (which will hopefully survive this and you can paste into a text file):

    {"quote":""In our town we are at the frontier of this brave and dangerous new world, but it's the tip of the iceberg as it were – the possibilities and adventures that lay ahead are going to be very exciting indeed.""}

    Dev Bug 
    opened by ghost 10
  • Large/small exponents frequently give inappropriate results

    Large/small exponents frequently give inappropriate results

    3.1a3's DisplayPretty:

    in: [5.0e-200] out: [500000000000000000000000000000000000000000000000000000000]

    in: [5.0e-300] out: [0.00000000000000000000000000000000000000000005]

    in: [5.0e200] out: [0.00000000000000000000000000000000000000000000000000000005]

    in: [5.0e300] out: [500000000000000000000000000000000000000000000]

    Bug 
    opened by trevyn 10
  • Crash when parsing non-UTF-8 strings

    Crash when parsing non-UTF-8 strings

    SBJson4Parser will crash when parsing invalid UTF-8 strings such as ["\xFF"].

    *** Assertion failure in -[SBJson4Parser parserFound:isValue:], SBJson4Parser.m:150
    *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: obj'
    *** First throw call stack:
    (
        0   CoreFoundation                      0x00007fff95f4b4f2 __exceptionPreprocess + 178
        1   libobjc.A.dylib                     0x00007fff9783bf7e objc_exception_throw + 48
        2   CoreFoundation                      0x00007fff95f501ca +[NSException raise:format:arguments:] + 106
        3   Foundation                          0x00007fff9ce86856 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
        4   test_SBJSON                         0x00000001000067e5 -[SBJson4Parser parserFound:isValue:] + 309
        5   test_SBJSON                         0x00000001000073f3 -[SBJson4Parser parserFoundString:] + 67
        6   test_SBJSON                         0x0000000100004289 -[SBJson4StreamParser parse:] + 2377
        7   test_SBJSON                         0x0000000100007989 -[SBJson4Parser parse:] + 73
        8   test_SBJSON                         0x0000000100005d0d main + 221
        9   libdyld.dylib                       0x00007fff929ea5ad start + 1
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException
    
    Bug 
    opened by nst 9
  • SBJson (ARC) on iOS 4.3

    SBJson (ARC) on iOS 4.3

    When trying to run my app using latest SBJson build (including ARC) on iPhone 4.3 Simulator the application crashes on runtime with the following message and stops inside the init of SBJsonParser (line:[email protected]):

    dyld: lazy symbol binding failed: Symbol not found: _objc_storeStrong
    Referenced from: [...]
    Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/Foundation.framework/Foundation
    

    Any idea what went wrong?

    Dev Bug 
    opened by hohl 9
  • Unable to parse large datasets

    Unable to parse large datasets

    I'm running into an issue attempting to parse large datasets with the new streaming parser. The problem stems from how memory is being managed in the framework. Specifically, each invocation of SBJsonUTF8Stream's getSimpleString method creates an autoreleased string that won't get released the current pool is drained. In my case that amounts to 100s of megabytes of wasted memory which obviously causes a crash.

    Am I misunderstanding the intent of this API?

    opened by bobmccune 9
Releases(v5.0.3)
  • v5.0.3(Jan 31, 2020)

  • v5.0.3-rc1(Jan 26, 2020)

  • v5.0.3-alpha2(Jan 19, 2020)

    • Removed the SBJson5Stream{Parser,Writer}State singletons and use per parser/writer instances instead.
    • Properly hid the SBJson5Stream{Parser,Writer}State helper classes from the public interface.
    Source code(tar.gz)
    Source code(zip)
  • v5.0.3-alpha1(Jan 19, 2020)

    This is the first release after migrating the Git repo from stig/json-framework to its new home at SBJson/SBJson.

    Changes include:

    • Migrating CI from Travis to CircleCI
    • Migrated Emacs Org files to Markdown for ease of contribution
    • Add Carthage CI test job to avoid breaking it in the future
    • Added template Cocoapods podspec
    • Add Cocoapods pod lib lint CI step to catch problems early
    • Add Cocoapods job to run pod trunk push for releases
    • Fixed a test that broke due to filesystem traversal no longer being in alphabetical order
    • Fixed a signedness issue in the sbjson cli tool
    • Swapped NEWS files around so the current one has no version number
    • Updated CREDITS
    • Updated/automated release procedures
    • Removed static NSNumber instances in the writer
    Source code(tar.gz)
    Source code(zip)
  • v5.0.1(Jul 25, 2019)

    In addition to the "headline" item, this patch release also quashes some warnings.

    See what changed: https://github.com/stig/json-framework/compare/v5.0.0...v5.0.1

    Source code(tar.gz)
    Source code(zip)
  • v5.0.0(Nov 15, 2016)

    I certainly didn't a month ago.

    This is the second release motivated by Nicholas Seriot's Parsing JSON is a Minefield post.

    Targeting RFC 7159

    This release allows scalar values at the top level; as recommended by RFC 7159, which obsoletes the original RFC 4627. Since it is a change in behaviour I chose to bump the major version to 5.

    Please note: When parsing numbers at the top level there is no way to differentiate 42 on its own from 4200 truncated to just the first two digits. This problem affects SBJson 5 because it expects to receive input bit-by-bit. When SBJson 5 sees "42" on its own it returns SBJson5WaitingForData, since cannot be sure it has seen the full token yet, and needs more data to make sure. A workaround for this issue could be to append a space or newline to your input if you intend to give SBJson 5 the whole input in one go. This is not an issue with any of the other JSON datatypes because they are either fixed length (true, false, null) or have unambigous delimiters at both ends ([], {}, "").

    • https://github.com/stig/json-framework/pull/238
    • https://github.com/stig/json-framework/pull/239

    Rename all classes & public symbols

    Because the class names contains the major version number a major-version bump necessitates renaming all the classes & enums. The upshoot of this is that you can use SBJson 3, 4 and 5 in the same application without problems. (Though why you would want to I cannot even begin to guess at.)

    • https://github.com/stig/json-framework/commit/736dbb1c3fe9dfa85e2c89a4a020479ee2a37619

    Remove the processBlock: API

    This release removes the untested processBlock: interface. I believe it was a distraction from SBJson's core purpose: to parse & generate JSON. Additionally this API had no tests, and the code had a lot of special case hooks all over the SBJson*Parser class to do its work.

    SBJson actually has two parsers: the low-level SBJson5StreamParser and the higher-level SBJson5Parser providing a block interface. I believe it's better to just do what the processBlock interface did in SBJson5Parser's value block. However, you could also use the stream parser to implement the processBlock interface yourself.

    • https://github.com/stig/json-framework/pull/242

    Constructor changes for parsers + writers

    Since I decided to bump the major version number anyway, I took the opportunity to iron out some UI niggles that's been bothering me for a while. Now we take options as constructor parameters rather than as properties for boh the parsers and writers, to avoid the impression that you can (and that it might make sense!) to change these settings during parse/generation. It is absolutely not supported, and that should be more clear now.

    • https://github.com/stig/json-framework/pull/243
    • https://github.com/stig/json-framework/pull/247

    Add a sbjson binary for reformatting JSON

    This can be useful from a sort of what would SBJson do? point of view. It takes some options. Here's the result of invoking it with --help:

    Usage: sbjson [OPTIONS] [FILES]
    
    Options:
      --help, -h
        This message.
      --verbose, -v
        Be verbose about which arguments are used
      --multi-root, -m
        Accept multiple top-level JSON inputs
      --unwrap-root, -u
        Unwrap top-level arrays
      --max-depth INT, -m INT
        Change the max recursion limit to INT (default: 32)
      --sort-keys, -s
        Sort dictionary keys in output
      --human-readable, -r
        Format the JSON output with linebreaks and indents
    
    If no FILES are provided, the program reads standard input.
    

    Run sbjson under American Fuzzy Lop

    To try and shake out any new crashes, I've run the sbjson binary alluded to above under American Fuzzy Lop. I didn't find any more crashes in the parser after fixing the bugs that went into v4.0.4, but wanted to share this with you to show I tried to find more bugs before releasing v5.

    Here's a snapshot of the latest session I've run:

                           american fuzzy lop 2.35b (master)
    
    ┌─ process timing ─────────────────────────────────────┬─ overall results ─────┐
    │        run time : 1 days, 12 hrs, 36 min, 22 sec     │  cycles done : 11     │
    │   last new path : 0 days, 0 hrs, 34 min, 26 sec      │  total paths : 583    │
    │ last uniq crash : none seen yet                      │ uniq crashes : 0      │
    │  last uniq hang : 0 days, 2 hrs, 10 min, 54 sec      │   uniq hangs : 47     │
    ├─ cycle progress ────────────────────┬─ map coverage ─┴───────────────────────┤
    │  now processing : 170 (29.16%)      │    map density : 0.39% / 1.49%         │
    │ paths timed out : 0 (0.00%)         │ count coverage : 5.02 bits/tuple       │
    ├─ stage progress ────────────────────┼─ findings in depth ────────────────────┤
    │  now trying : splice 7              │ favored paths : 93 (15.95%)            │
    │ stage execs : 5/32 (15.62%)         │  new edges on : 142 (24.36%)           │
    │ total execs : 18.1M                 │ total crashes : 0 (0 unique)           │
    │  exec speed : 282.7/sec             │   total hangs : 297 (47 unique)        │
    ├─ fuzzing strategy yields ───────────┴───────────────┬─ path geometry ────────┤
    │   bit flips : 0/678k, 4/677k, 0/677k                │    levels : 15         │
    │  byte flips : 0/84.8k, 0/84.5k, 0/83.9k             │   pending : 31         │
    │ arithmetics : 0/4.72M, 0/16.6k, 0/307               │  pend fav : 0          │
    │  known ints : 0/480k, 0/2.35M, 0/3.69M              │ own finds : 40         │
    │  dictionary : 0/0, 0/0, 2/2.49M                     │  imported : 3          │
    │       havoc : 29/1.25M, 5/753k                      │ stability : 100.00%    │
    │        trim : 11.02%/43.6k, 0.00%                   ├────────────────────────┘
    ^C────────────────────────────────────────────────────┘             [cpu: 69%]
    
    +++ Testing aborted by user +++
    [+] We're done here. Have a nice day!
    
    • https://github.com/stig/json-framework/pull/246

    Fix bug in unwrapper code that caused arrays to be skipped

    Whilst playing with AFL I accidentally found (and fixed) a bug where the unwrapRootArray parser would break on any arrays at the next-to-outermost level.

    • https://github.com/stig/json-framework/pull/244

    Improved documentation

    I've tried to improve the documentation a little, both in README and the API documentation in the header files.

    Source code(tar.gz)
    Source code(zip)
  • v4.0.5(Nov 15, 2016)

    Fixes an embarrassing bug in the unwrapRootArrayParser that made the parser ignore any output after an array entry at depth 1. (I.e. a direct child of the root array.)

    Source code(tar.gz)
    Source code(zip)
  • v4.0.4(Nov 3, 2016)

    Oh, er, well, this is a bit embarrassing. It turns out my tests were insufficently devious, and did not guard against invalid UTF-8 encodings. I thought I could punt on UTF-8 validation and rely on [NSString initWithBytes:length:encoding] to do it, but then Nicolas Seriot reported otherwise (issue #219). The result is that this version won't crash on a whole range invalid UTF-8 byte sequences where previous versions crashed did:

    • Flat-out illegal UTF-8 byte values
    • Missing continuation bytes
    • Unexpected continuation bytes
    • Overlong encodings
    • Invalid Unicode code points

    After 9 years of calling SBJson a strict JSON parser I've finally implemented UTF-8 validation. Thank you for the learning opportunity Nicolas!

    Also in this release:

    • Recreate the project file and targets using Xcode 8.
    • Re-organising the frankly bonkers repo layout to hopefully make it easier for casual contributors to find their way around.
    • Fix the Travis build; this had broken due to bit rot.
    Source code(tar.gz)
    Source code(zip)
  • v4.0.3(Jul 7, 2016)

    Minor bug fix release.

    • 207dfa3 Adjust Travis CI configuration (#1)
    • 191b0ad Rename Carthage Mac target
    • 23e47df Update README.md
    • ed536b5 Add Carthage iOS target
    • d53dfe4 Add repo status to README
    • 4ca1d84 Replace deprecated method with alternative
    • d088bd1 Add codecov badge to README
    • 4e7df93 Make variable private
    • 2983d71 Attempt at adding code test coverage metrics
    • 959f5bd Make link (hopefully) to LICENCE
    • 52ab522 Add a top-level heading to README
    • abe079d Update to-date on license
    • bff9599 Remove prefix headers
    • 2fbe784 Use Xcodebuild rather than xctool
    • 5f63aa0 Add Gitter URL to README
    Source code(tar.gz)
    Source code(zip)
  • v4.0.2(Nov 3, 2016)

    A few patches to address warnings submitted by various people.

    • a34295f Merge pull request #201 from isimpson/patch-1
    • 6069c12 Fix semantic issue Xcode warning
    • ceaa84a Update travis-ci to use a build matrix rather than explicit script
    • 647ff7e Add semicolons after block - fixes #198
    • 34b2d47 Update README.md
    • f4933c9 Merge pull request #194 from karelia/master
    • beed41a Return NULL for invalid chars
    • 64ea007 Readme update
    • e628af0 Slightly saner error handling (thanks AppCode!)
    • 852f607 Inline method (thanks AppCode!)
    • 20a2ece Add cast to correct unmatched type issue (thanks AppCode!)
    • 18cbb6c Fix typos in comments and variable names (thanks AppCode!)
    • a90dddf Killed 58 lines of unreachable code (thanks AppCode!)
    • 024672c Simplify expression as suggested by AppCode
    • f999088 Remove broken example (twitter no longer support basic auth)
    • dba2719 Create a new (external) DisplayPretty project and link to it rather than embed it
    • f7ee521 fixup! Extract LICENSE from README again (I changed my mind...)
    • 59d3810 Extract LICENSE from README again (I changed my mind...)
    Source code(tar.gz)
    Source code(zip)
  • v4.0.1(Nov 3, 2016)

    Change installation instructions to recommend use of CocoaPods.

    Started using http://travis-ci.org to ensure builds are good. This now runs tests for both iOS and OSX build of the library.

    Fix method names in API documentation examples.

    Modernise and tidy up a bit by:

    • Convert tests to use XCTest rather than OCUnit.
    • Remove unnecessary schemes.
    • Turn on analyze for tests too.
    • Enable modules & drop explicit dependency on Foundation.
    • Make precompiled headers use Foundation/Foundation.h rather than UIKit / Cocoa headers.
    • Upgrade to latest Xcode5.1 recommended settings.
    • Remove annoying (but harmless) warning about ARC retain cycle in tests.

    Full list of commits:

    • 6e28701 Run tests for both iOS and OSX
    • b93a64b Turn on analyze for tests too
    • 816cca4 Convert OCUnit to XCTest
    • 0546997 Remove unnecessary schemes
    • eca32c2 Enable Modules
    • 91be3a7 Upgrade to latest Xcode settings
    • f17611c README updates
    • 1b60dd1 Make Podfile documentation a bit clearer
    • 79c814b Update copyright year
    • e1c770c Update README
    • 0a60393 Remove annoying (but harmless) warning about ARC retain cycle in tests
    • d23adbc Update README.md
    • 259fa96 Build-status information from Travis
    • 8651019 Add shared Xcode schemes for Travis
    • f0f1d61 Add .travis.yml to integrate with travis-ci.org
    • fb05d7d Clarify example in documentation
    • 928a69d Fix documentation
    Source code(tar.gz)
    Source code(zip)
  • v4.0.0(Dec 16, 2013)

    I'm happy to announce the fourth major release of SBJson! As mentioned in this blog post the focus for this release has been on making the chunk-based (aka streaming) API much simpler to use, and I believe this is the case.

    Because this release is not backwards compatible with previous versions all classes, constants & enums were renamed to contain the number 4. This is so that you can use the new APIs while still relying on libraries that bundle older versions of this library.

    Remove the old SBJsonParser and created a new chunk-oriented one based on version 3.2's SBJsonStreamParserAdapter.

    This release also includes two important parsing fixes related to number parsing. We now support the full range of unsigned long long as a proper integer type, and properly support the full range of double. In doing so SBJson was changed to never produce a NSDecimalNumber, but always return NSNumber instances.

    Source code(tar.gz)
    Source code(zip)
  • v4.0.0-alpha3(Nov 17, 2013)

    Notable changes since 4.0.0-alpha2:

    • f7ef205 Add documentation for more convenience constructors
    • 49bcff0 Rename classes, constants & enums to add major version number (4)
    • fda671c Remove old SBJsonParser and rename SBJsonChunkParser to SBJsonParser
    • c053beb Changed secondary init method to be a class method instead
    • faaa654 Remove parser as argument to all its delegate methods
    • e8a1444 Move max-depth error handling from stream parser to chunk-parser
    • 4ef698e Make SBJsonChunkParser "immutable" by removing properties
    • d6342f6 Use the ChunkParser in the DisplayPretty example
    Source code(tar.gz)
    Source code(zip)
  • v4.0.0-alpha2(Nov 13, 2013)

    Notable changes since 4.0.0-alpha:

    • d13a5a8 Support stopping parsing after a certain number of partial documents
    • cbdd83c Replace SBJsonStreamParserAdapter with SBJsonChunkParser
    • a52fefa Update DisplayPretty example to use ARC
    • 9bedeec Turn on most sensible warnings
    • 641f506 Move properties to be nonatomic, and remove explicit @synthesize declarations
    • b41acb1 Use weak rather than unsafe_unretained (no longer support iOS < 5)
    • c3f7db0 Make the "skip outer array" option of the stream parser easier to understand.
    • f342770 Move multi-document support chosing to the parser delegate, so decision can be done in the adapter
    • 28a7c73 Update documentation to remove reference to -autorelease method
    • ab11d2b Remove the silly parser/writer Accumulators
    • b02a095 Avoid warning for Mac OS X build
    Source code(tar.gz)
    Source code(zip)
  • v4.0.0-alpha(Nov 9, 2013)

    I'm delighted to announce SBJson 4.0.0-ALPHA. Notable changes since 3.2.0:

    • #160 & #162 - Remove category & ...error:(NSError**)error methods.
    • #171 - Support full range of unsigned long long as proper integer type.
    • #128 - Support full range of double. This also removes NSDecimalNumber support.
    • #180 - Add @rpath support to SBJson.framework build settings.
    • #182 - Add option to process values as they’re parsed.

    The main reason for a major version change is the removal of the some methods, to allow focus on streaming as explained in this blog post. The change to support the full range of double was also significant enough that it might have warranted a major version release on its own.

    Several community members have contributed to this release.

    Source code(tar.gz)
    Source code(zip)
  • v3.2.0(Nov 18, 2013)

  • v3.2.0rc1(Nov 18, 2013)

    Deprecations

    • Deprecated the JSONValue and JSONRepresentation category methods.
    • Deprecated several methods that return an error through an NSError** argument.

    These will be removed in the next major version release.

    Changes

    • Absorb LICENSE and INSTALL files into README.
    • Remove the Xcode Workspace from the top-level source checkout; the less clutter the better and this doesn't seem to serve any function.
    • Change to use AppleDoc for creating API documentation. This results in output looking more consistent with Apple's documentation.

    Bugfixes

    • Replace use of INFINITY with HUGE_VAL where used as double (reported by Antoine Cœur)
    • Correctly parse -0.0 as a JSON number (Cary Yang)
    Source code(tar.gz)
    Source code(zip)
Owner
Home of the SBJson Objective-C parser/generator
null
Decodable Simple and strict, yet powerful object mapping made possible by Swift 2's error handling.

Decodable Simple and strict, yet powerful object mapping made possible by Swift 2's error handling. Greatly inspired by Argo, but without a bizillion

Johannes Lund 1k Jul 15, 2022
Jay - Pure-Swift JSON parser & formatter. Fully streamable input and output. Linux & OS X ready.

Pure-Swift JSON parser & formatter. Fully streamable input and output. Linux & OS X ready. Replacement for NSJSONSerialization.

Danielle 132 Dec 5, 2021
Functional JSON Parser - Linux Ready

Functional JSON Parser Feature Linux Ready Type-safe JSON parsing Functional value transformation Easy to parse nested value Dependency free No define

Ryo Aoyama 117 Sep 9, 2022
A JSON parser with concise API written in Swift.

A JSON parser with concise API written in Swift Maps JSON attributes to different Swift types with just two methods: map and mapArrayOfObjects. The li

Evgenii Neumerzhitckii 14 Aug 13, 2018
JSONNeverDie - Auto reflection tool from JSON to Model, user friendly JSON encoder / decoder, aims to never die

JSONNeverDie is an auto reflection tool from JSON to Model, a user friendly JSON encoder / decoder, aims to never die. Also JSONNeverDie is a very important part of Pitaya.

John Lui 454 Oct 30, 2022
JSEN (JSON Swift Enum Notation) is a lightweight enum representation of a JSON, written in Swift.

JSEN /ˈdʒeɪsən/ JAY-sən JSEN (JSON Swift Enum Notation) is a lightweight enum representation of a JSON, written in Swift. A JSON, as defined in the EC

Roger Oba 8 Nov 22, 2022
JSON-Practice - JSON Practice With Swift

JSON Practice Vista creada con: Programmatic + AutoLayout Breve explicación de l

Vanesa Giselle Korbenfeld 0 Oct 29, 2021
Ss-json - High-performance json parsing in swift

json 0.1.1 swift-json is a pure-Swift JSON parsing library designed for high-per

kelvin 43 Dec 15, 2022
Swift-json - High-performance json parsing in swift

json 0.1.4 swift-json is a pure-Swift JSON parsing library designed for high-per

kelvin 43 Dec 15, 2022
The better way to deal with JSON in Objective-C (inspired by SwiftyJSON)

NSTEasyJSON Inpired by SwiftyJSON. NSTEasyJSON makes it easy to deal with JSON data in Objective-C. Why is the typical JSON handling in Objective-C NO

Timur Bernikovich 11 Apr 2, 2020
A fast, convenient and nonintrusive conversion framework between JSON and model. Your model class doesn't need to extend any base class. You don't need to modify any model file.

MJExtension A fast, convenient and nonintrusive conversion framework between JSON and model. 转换速度快、使用简单方便的字典转模型框架 ?? ✍??Release Notes: more details Co

M了个J 8.5k Jan 3, 2023
Elevate is a JSON parsing framework that leverages Swift to make parsing simple, reliable and composable

Elevate is a JSON parsing framework that leverages Swift to make parsing simple, reliable and composable. Elevate should no longer be used for

Nike Inc. 611 Oct 23, 2022
HandyJSON is a framework written in Swift which to make converting model objects to and from JSON easy on iOS.

HandyJSON To deal with crash on iOS 14 beta4 please try version 5.0.3-beta HandyJSON is a framework written in Swift which to make converting model ob

Alibaba 4.1k Dec 29, 2022
ObjectMapper is a framework written in Swift that makes it easy for you to convert your model objects to and from JSON.

ObjectMapper is a framework written in Swift that makes it easy for you to convert your model objects (classes and structs) to and from J

Tristan Himmelman 9k Jan 2, 2023
Magical Data Modeling Framework for JSON - allows rapid creation of smart data models. You can use it in your iOS, macOS, watchOS and tvOS apps.

JSONModel - Magical Data Modeling Framework for JSON JSONModel allows rapid creation of smart data models. You can use it in your iOS, macOS, watchOS

JSONModel 6.9k Dec 8, 2022
Magical Data Modeling Framework for JSON - allows rapid creation of smart data models. You can use it in your iOS, macOS, watchOS and tvOS apps.

JSONModel - Magical Data Modeling Framework for JSON JSONModel allows rapid creation of smart data models. You can use it in your iOS, macOS, watchOS

JSONModel 6.8k Nov 19, 2021
Swift/Obj-C HTTP framework with a focus on REST and JSON

Now Archived and Forked PMHTTP will not be maintained in this repository going forward. Please use, create issues on, and make PRs to the fork of PHMT

Postmates Inc. 509 Sep 4, 2022
A sweet and swifty YAML parser built on LibYAML.

Yams A sweet and swifty YAML parser built on LibYAML. Installation Building Yams requires Xcode 11.x or a Swift 5.1+ toolchain with the Swift Package

JP Simard 930 Jan 4, 2023
A lightweight CSS parser for parsing and creating CSS stylesheets

SwiftCSSParser A lightweight CSS parser for Swift that uses cssparser (cpp) under the hood. Basic usage Here's a simple code snippet to get you starte

null 9 Jul 20, 2022