taquitos / jlobjectmapping Goto Github PK
View Code? Open in Web Editor NEWSimple JSON to object and object to JSON mapping inspired by Jackson JSON Processor for Java.
License: MIT License
Simple JSON to object and object to JSON mapping inspired by Jackson JSON Processor for Java.
License: MIT License
This happens when you have an override in the propertyNameMap (to remap a JSON property name to an objc property name) and the JSON also includes the same name of the property:
{
"name":"josh",
"username":"turtles",
}
objc-
@Property username;
this shows that we should map JSON property "name" (josh) to the objc property "username". Since "username" (turtles) exists in the JSON as well, we can't guarantee which one will win out. We should probably spit out an error or something.
When running test target for 64bit, there are multiple failures
NSObject category defines + (NSDictionary *)propertyNameMap
but the serializer/deserializer doesn't do anything with it. It's a missing feature
at a glance, - (NSSet *)loadPropertyMapForClass:(Class)class doesn't consider properties from the super class. This can be problematic. Write some unit tests and test it out.
Wrap the NSJSONSerialization class in a non-arc compiled class and use that instead of directly catching it in JLObjectDeserializer -_objectWithString:targetClass:
Right now enums and options are transcoded as whatever primitive values they are backed by. It would be nice to be able to provide strings that map to those values:
typedef NS_ENUM(NSInteger, MyEnum) {
MyEnumAValue = 1,
MyEnumSecondValue,
MyEnumThirdValue
};
so MyEnumSecondValue could map to "SecondValue" in the JSON instead of "2" (and so on)
We use NSMutableDictionary *classPropertiesNameMap;
that's ok, but NSCache would be ideal to handle any memory pressure events. Probably not a big deal.
maybe mark fields automatically as required, meaning you have to mark fields as not required if they are optional. On error, return nil and maybe out param nserror?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.