Giter VIP home page Giter VIP logo

vertigo.json's People

Contributors

enricosada avatar erichgoldman avatar jorgef avatar precisemath avatar tombert avatar vsapronov avatar

Stargazers

 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vertigo.json's Issues

Differentiate between null and missing fields after deserializing

Currently if we have something like
type A = {
x: string option
y: string option
}
both x and y are deserialized into None type for both cases where they are missing and null in the original json.

There should be an option to deserialize the json such that the null fields are differentiable from the missing fields in the final obj.

Fails to serialize and deserialize private types

type private Person = 
{
    firstName: string
    lastName: string
}

let x = 
{
    firstName = "John"
    lastName = "Doe"
}

Json.serialize x

The above snippet throws an error saying that the type is not a Record. It would be great if the error message could identify that the type is inaccessible, or suggest making sure that the type is publicly scoped.

Exception when serializing type: obj option

Sample code

        let l = ["a", (Some (1 :> obj))]
        printfn "json: %s" (l |> Map.ofList |> Json.serialize)

Exception:

Unhandled Exception: System.Exception: Unknown type: Type=Object
   at Vertigo.Json.Internals.NonOption$cont@204(JsonConfig config, Object value, Type t, Unit unitVar)
   at Vertigo.Json.Internals.Serialize.NonOption(JsonConfig config, Type t, Object value, JsonProperty attr)
   at Vertigo.Json.Internals.Serialize.Option(JsonConfig config, Type t, Object o, JsonProperty attr)
   at [email protected](Object o)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.map@74.DoMoveNext(b& curr)
   at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System-Collections-IEnumerator-MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at Microsoft.FSharp.Collections.SeqModule.ToArray[T](IEnumerable`1 source)
   at Vertigo.Json.Internals.Serialize.Map(JsonConfig config, IEnumerable kvps)
   at Vertigo.Json.Json.serialize(Object objekt)

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.