GithubHelp home page GithubHelp logo

json.netmf's People

Contributors

adriansoundy avatar andylyonette avatar haeberle avatar josesimoes avatar mweimer avatar networkfusion avatar nfbot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

json.netmf's Issues

JsonSerializer ignore value for TimeSpan objects

Hi,

just adding such things should fix this:

case "TimeSpan":
{
TimeSpan timeSpan = (TimeSpan)o;
return """ + timeSpan.Days + "d " + timeSpan.Hours + "h " + timeSpan.Minutes + "m "
+ timeSpan.Seconds + "s " + timeSpan.Milliseconds + "m " + """;
}

Nested objects cause InvalidCast exception

If you have a JSON string that has a field that is another object, even if that object is null, DeserializeString() will blow up with an InvalidCast exception.

Expected:
Just "skip" the nested object type and pass it as a string in the parent so it can be parsed further later.

Example:
{"firstName":"John","lastName":"Doe", "Car":{"make":"Ford","model":"F350"}}

The "car" is another object, so when deserializing this, do:
hashTable["firstName"]
hashTable["lastName"]
hashTable["Car"]

Now the result of "firstName" would be "John" but the result of "Car" would be a JSON STRING: {"make":"Ford","model":"F350"}

and then we can deserialize that further manually as needed:
hashTable["make"]
hashTable["model"]

Matt and Matt,

This is so great to see this project being developed further! It's the only JSON utility for NetMF, really. Good work! I'll help where I can. I have some bug fixes from the old IndianaJones project that I will have to see are still present here after some testing, and contribute some fixes if needed. (this nested object situation wasn't among them)

system.exception on DateTimeExtensions.FromIso8601

Installed from nuget.
I have tested this code block and get an exception from the extension method DateTimeExtensions.FromIso8601().

#### Exception System.Exception - 0x00000000 (1) ####
#### Message: 
#### System.Convert::ToInt64 [IP: 00af] ####
#### System.Convert::ToInt32 [IP: 0011] ####
#### Json.NETMF.DateTimeExtensions::FromIso8601 [IP: 0083] ####
#### testJSONParse.Program::Main [IP: 0017] ####

Test:
DateTime nowTime = DateTime.Now;
JsonSerializer dataSerializer = new JsonSerializer(DateTimeFormat.ISO8601);
string jsonString = dataSerializer.Serialize(nowTime);
DateTime convertTime = DateTimeExtensions.FromIso8601(jsonString); // exception
Debug.Print("Converted: " + jsonString);

If I attempt to step into the files downloaded from Github I get told the source and nuget files are different, maybe a different issue, but the exception seems to be thrown by the parsing of YEAR which seems to have a leading quote mark. From JSON visualizer the text seems formed correct:
[JSON]: "22/04/2015 10:18:54 PM"

I can't be sure if the date.Split() is incomplete, or if the leading quote isn't working, or if there's some other issue. Any thoughts ?

Add support for .NET MF 4.3 RTM (QFE1)

Current version it built against .NET MF 4.3 (RTM) and does not work with .NET MF 4.3 RTM (QFE1). It needs to be recompiled with latest version of framework.

Array serialization issue

Hi.

it seems that serialization skips serializing properties whose type is arrays/enumerables of custom objects, since this expression returns true:

(jsonserializer.cs Line 148) (method.ReturnType.IsAbstract)))

Maybe it should be replaced with:

(!method.ReturnType.IsArray && method.ReturnType.IsAbstract)))

Json.NetMF 1.3.0.0 installed successfully, but complains of missing some assembly when loading

Json.NetMF was installed via PM (command-line) on NetMF 4.4. There are no dependencies listed for this version of NetMF, so assumed all was good until I tried loading onto target (the special chars in the error statement are as they appear and haven't been modified).

Does anyone have an idea of what might be the missing assembly here? (mscorlib 4.4.0.0 is present)

Assembly: Json.NetMF (1.3.0.0) Attaching deployed file.

Assembly: System.IO (4.4.0.0) Attaching deployed file.

Assembly: AP200NetMFApplication (1.0.0.0) Resolving.

Link failure: some assembly references cannot be resolved!!

Assembly: Json.NetMF (1.3.0.0) needs assembly ' �~��(B����+��' (4.3.1.0)

Assembly: AP200NetMFApplication (1.0.0.0) needs assembly 'Json.NetMF' (1.3.0.0)

Error: a3000000

Waiting for debug commands...

The program '[5] Micro Framework application: Managed' has exited with code 0 (0x0).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.