finds.dev

CoderMJLee/MJExtension

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.

View on GitHub

★ 8,497Objective-CMITupdated Mar 2024

// the take

MJExtension is an Objective-C library that maps JSON dictionaries to model objects using runtime reflection, without requiring your models to inherit from a base class. It handles nested models, array-of-models, key remapping, and NSCoding boilerplate via macros. The audience is iOS developers still maintaining ObjC codebases or mixed ObjC/Swift projects that can't or won't migrate to Codable.

Uses ObjC runtime to introspect properties without code generation or base class inheritance, which keeps models clean. Key path mapping (e.g., 'name.info[1].nameChangedTime') handles messy nested JSON structures that would require custom Codable implementations. MJCodingImplementation macro eliminates NSCoding boilerplate entirely. The test suite covers Core Data, NSSecureCoding, camel/underline conversion, and multi-threading — not just the happy path.

This is fundamentally a pre-Swift-4 solution: Swift's Codable, introduced in 2017, does everything MJExtension does with compile-time safety and no runtime reflection overhead. Swift usage requires @objcMembers and dynamic keywords that fight against Swift's type system, and the author explicitly points you to KakaJSON instead. Last meaningful activity is 2024 but the real work stopped years earlier — the library is in maintenance mode. Runtime reflection means mapping errors (wrong key names, type mismatches) fail silently at runtime rather than at compile time, which is exactly the class of bug that Codable was designed to eliminate.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
8,497
Forks
2,133
Language
Objective-C
License
MIT
Last commit
13 Mar 2024

// nearby

If MJExtension isn't quite it.

All repos →