Comments (8)
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.
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.
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.
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.
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.
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.
Original comment by [email protected]
on 2 Jul 2008 at 10:21
- Added labels: Milestone-Release2.1
from jsonexserializer.
Original comment by [email protected]
on 10 Jul 2008 at 5:02
- Changed state: Verified
from jsonexserializer.
Related Issues (20)
- Type information provided by "new" ctor style gets overwritten HOT 2
- Anonymous types HOT 2
- Possible to ignore errors for missing properties? HOT 5
- an exception when read xml config HOT 3
- ENHANCEMENT: IgnoreProperties using RegExp HOT 2
- decimal with regional setting HOT 5
- Fail to deserialize nullable double with culture fr-FR HOT 2
- Serializing DateTimes with custom converter HOT 1
- No serialization fΓΌr Read-Only properties HOT 2
- Better error messages for expression to expression handler mismatch HOT 2
- Improve error mesages for parsing and evaluation errors HOT 2
- Deserialize float.NegativeInfinity ("-Infinity") fails HOT 1
- A class derived from List<type> is serialised as an List<type> so other class properties are not serialised HOT 1
- Ignore Properties of custom objects doesn't work
- Convert code to 4.0
- Create compliant JSON always
- Enhanced registration of converters, type overrides, etc
- Use compiled expressions instead of reflection for performance
- Allow Json Reader/Writer style serialization/deserialization
- Any expression starting with [ is considered a numeric expression HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsonexserializer.