This project has moved and is read-only. For the latest updates, please go here.

Ignoring Comments with a JsonTextReader

Aug 11, 2009 at 11:20 AM

I was wondering if you'd considered adding an option to JsonTextReader and the similar classes that would allow comments in the JSON to be silently discarded?

This would be very helpful to me.


Aug 15, 2009 at 2:21 AM

Why don't you want comments?

You could inherit from JsonTextReader, override Read() and have it call base.Read() again whenever it encounters a comment.

Aug 17, 2009 at 1:27 PM

Good suggestion, have now done that.

I don't want comments since the data I'm parsing may/may not contain comments (most likely not) and it's easier to parse if you can assume there's no comments.