Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Group info
Members: 198
Language: English
Group categories:
Computers > Programming
More group info »
Recent pages and files
Json Schema Proposal First Draft    
This page is obsolete, please see the second draft.
Version: 
Latest 3 messages about this page (49 total) - view full discussion
Jan 23 2008 by Matt (MPCM)
"JavaScript contains a small set of data types. It has the three
primitive types boolean, number, and string and the special values
null and undefined. Everything else is variations on the object type."
- http://javascript.crockford.com/survey.html

"Vars are not typed. A var can contain a reference to an object, or a
Jan 23 2008 by David Wilhelm
I think it is useful to treat null as a type, as it doesn't belong to
any other type, but it is a valid JSON value.

On this topic, I noticed that when I attempt to validate the object:
{
"foo":null
with the schema:
{
"foo":{
"type":"null"
I'm still getting the error:
foo
is non-nullable, but has a null value
Jan 23 2008 by Jakob Kruse
Kris,

I find this choice rather questionable. The possible values of the
"type" defintion should be just that - types. "null" is not a type,
it's a value. Including "null" as a possible "type" value is just
starting down a slope where "true" and "false" come next (in JSON
specs they are treated the same), and that's just plain wrong.
46 more messages »
Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google