Giter Site home page Giter Site logo

Comments (8)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Properties are expected to have a Getter and a Setter in order to be serialized
otherwise deserialization will fail.  The "A" property on header has no setter 
so its
not serialized.  You can add the "JsonExProperty" attribute to the property to 
force
it to serialize.

Example:
public class Hdr {
    [JsonExProperty]
    public string A {get { return "A"; }}
}

How are you using this?  Are you doing only serialization, sending to a browser 
perhaps?

Original comment by [email protected] on 22 Jun 2008 at 1:05

from jsonexserializer.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
thank you very much for this information.
(I would add this to the quickstat wiki page).

> How are you using this?  Are you doing only serialization, sending to a 
browser
perhaps?

That's right, some data is read only so object designed accordingly. 

Original comment by [email protected] on 22 Jun 2008 at 3:37

from jsonexserializer.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
yet,
if the property is primitive (such as int) it fails @ 
metadata.proprtyhandler.validate.
any suggest how to hack this design?

Original comment by [email protected] on 22 Jun 2008 at 9:29

from jsonexserializer.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
I could probably remove that validation.  In the meantime you might be able to 
get
away with declaring a private or internal setter, although I'm not totally sure 
that
it still won't flag it as not being writable.  Example:
public class Hdr {
    [JsonExProperty]
    public string A {
       get { return "A"; }
       private set { ; }
    }
}

Original comment by [email protected] on 23 Jun 2008 at 1:55

from jsonexserializer.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
I set this (empty) private setter and it works!
thanks for writing this efficient library for us --- 

Original comment by [email protected] on 24 Jun 2008 at 7:54

from jsonexserializer.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
The validation to check for the property to be writable when using the 
JsonExProperty
attribute has been removed.

Original comment by [email protected] on 2 Jul 2008 at 10:19

  • Changed state: Fixed

from jsonexserializer.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024

Original comment by [email protected] on 2 Jul 2008 at 10:21

  • Added labels: Milestone-Release2.1

from jsonexserializer.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024

Original comment by [email protected] on 10 Jul 2008 at 5:02

  • Changed state: Verified

from jsonexserializer.

Related Issues (20)

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.