atuttle / cf-json-tests

Testing Adobe ColdFusion's JSON serialization functionality
2 stars 2 forks source link

CFCs from ORM are partially serialized #2

Open codymartin opened 10 years ago

codymartin commented 10 years ago

I don't have time to write up a test case but I'm struggling with this scenario and can not find anyone talking about it.

I have an ORM CFC with a string property:

property name="CompanyName"  column="company"   type="string";

serializeJSON drops this field, any field, that has a null value in the database. Upon passing the component to serializeJSON, I verified that the field is in the component object and is type=string and has an empty string as its value. SerializeJSON drops it completely instead of including it with a value of "".

I'm using CF 10

codymartin commented 10 years ago

If I add default="" to the property, it is returned.

atuttle commented 10 years ago

Thanks for logging the issue here. Has a corresponding bug been logged with Adobe at all? If so, please link it here, too! :)

codymartin commented 10 years ago

I couldn't find one in the bugbase. If I don't find that its really me that is bugged and not serializeJSON, I'll submit it. I really don't know if my expectation is legit.

atuttle commented 10 years ago

I think null should be serialized as null. Sounds like a bug to me.

Cody wrote:

I couldn't find one in the bugbase. If I don't find that its really me that is bugged and not serializeJSON, I'll submit it. I really don't know if my expectation is legit.

— Reply to this email directly or view it on GitHub https://github.com/atuttle/cf-json-tests/issues/2#issuecomment-24175980.