Discussion:
JSON Schema
w***@public.gmane.org
2013-11-12 17:23:29 UTC
Permalink
Someone asked me at the meeting if there was such a thing as a JSON Schema - turns out there is (at least something early).


http://json-schema.org/



Here is a Jackson implementation:


https://github.com/FasterXML/jackson-module-jsonSchema



Haven't looked into it to see how robust, etc. But, it exists. ;)


Cheers,
-Will
k***@u.washington.edu
2013-11-12 19:02:35 UTC
Permalink
I haven't looked at the fasterXML library, but I thought you might be having fun with the very different goals of JSON and XML. Let's make a WSDL too :) :).


---In ***@yahoogroups.com, <***@...> wrote:

Someone asked me at the meeting if there was such a thing as a JSON Schema - turns out there is (at least something early).

http://json-schema.org/



Here is a Jackson implementation:


https://github.com/FasterXML/jackson-module-jsonSchema



Haven't looked into it to see how robust, etc. But, it exists. ;)


Cheers,
-Will
Daniel Kirkdorffer
2013-11-13 04:05:01 UTC
Permalink
Interesting. I think I might have been the one who asked.

It seems like there is actually quite a lot of stuff out there in various
languages around this.

Doesn't surprise me given the notion that JSON is often considered a better
choice than XML, and yet there are whole industries out there still
embracing XML schemas.

Dan


-----Original Message-----
From: seajug-***@public.gmane.org [mailto:seajug-***@public.gmane.org] On Behalf Of
wiverson-***@public.gmane.org
Sent: Tuesday, November 12, 2013 9:23 AM
To: seajug-***@public.gmane.org
Subject: [seajug] JSON Schema




Someone asked me at the meeting if there was such a thing as a JSON Schema -
turns out there is (at least something early).





http://json-schema.org/


Here is a Jackson implementation:

https://github.com/FasterXML/jackson-module-jsonSchema


Haven't looked into it to see how robust, etc. But, it exists. ;)

Cheers,
-Will
k***@u.washington.edu
2013-11-13 04:21:00 UTC
Permalink
Definitely an interesting subject. I did think you or someone was kidding! JSON removes type safety to reduce the size of data transmitted while keeping the content in plain text, but XML wants to be self describing so is very verbose. One might prefer one solution or the other, but perhaps not both of those??
If the goals were small and type safety, and your types are set, you might like Google protocol buffers for the best of both worlds. Protocol Buffers API is implemented in many languages including javascript. :)






---In ***@yahoogroups.com, <***@...> wrote:

Message Interesting. I think I might have been the one who asked.

It seems like there is actually quite a lot of stuff out there in various languages around this.

Doesn't surprise me given the notion that JSON is often considered a better choice than XML, and yet there are whole industries out there still embracing XML schemas.

Dan


-----Original Message-----
From: ***@yahoogroups.com [mailto:***@yahoogroups.com] On Behalf Of ***@...
Sent: Tuesday, November 12, 2013 9:23 AM
To: ***@yahoogroups.com
Subject: [seajug] JSON Schema


Someone asked me at the meeting if there was such a thing as a JSON Schema - turns out there is (at least something early).


http://json-schema.org/



Here is a Jackson implementation:


https://github.com/FasterXML/jackson-module-jsonSchema



Haven't looked into it to see how robust, etc. But, it exists. ;)


Cheers,
-Will
Daniel Kirkdorffer
2013-11-13 04:25:48 UTC
Permalink
So are you suggesting that if you want a well described format go with XML?
But what if you want JSON, but would also like it to be well described? Why
should JSON preclude that?


-----Original Message-----
From: seajug-***@public.gmane.org [mailto:seajug-***@public.gmane.org] On Behalf Of
***@u.washington.edu
Sent: Tuesday, November 12, 2013 8:21 PM
To: seajug-***@public.gmane.org
Subject: RE: RE: [seajug] JSON Schema





Definitely an interesting subject. I did think you or someone was kidding!
JSON removes type safety to reduce the size of data transmitted while
keeping the content in plain text, but XML wants to be self describing so is
very verbose. One might prefer one solution or the other, but perhaps not
both of those??

If the goals were small and type safety, and your types are set, you might
like Google protocol buffers for the best of both worlds. Protocol Buffers
API is implemented in many languages including javascript. :)









---In seajug-***@public.gmane.org, <***@...> wrote:


Interesting. I think I might have been the one who asked.

It seems like there is actually quite a lot of stuff out there in various
languages around this.

Doesn't surprise me given the notion that JSON is often considered a better
choice than XML, and yet there are whole industries out there still
embracing XML schemas.

Dan




-----Original Message-----
From: seajug-***@public.gmane.org [mailto:seajug-***@public.gmane.org] On Behalf Of
***@...
Sent: Tuesday, November 12, 2013 9:23 AM
To: seajug-***@public.gmane.org
Subject: [seajug] JSON Schema




Someone asked me at the meeting if there was such a thing as a JSON Schema -
turns out there is (at least something early).


http://json-schema.org/


Here is a Jackson implementation:

https://github.com/FasterXML/jackson-module-jsonSchema


Haven't looked into it to see how robust, etc. But, it exists. ;)

Cheers,
-Will
k***@u.washington.edu
2013-11-13 04:30:14 UTC
Permalink
I can't see the message I just sent yet. I see on the web interface this from you, Daniel:
"So are you suggesting that if you want a well described format go with XML? But what if you want JSON, but would also like it to be well described? Why should JSON preclude that?"


To understand your question better, how do you use JSON?


---In ***@yahoogroups.com, <***@...> wrote:

Message So are you suggesting that if you want a well described format go with XML? But what if you want JSON, but would also like it to be well described? Why should JSON preclude that?


-----Original Message-----
From: ***@yahoogroups.com [mailto:***@yahoogroups.com] On Behalf Of ***@...
Sent: Tuesday, November 12, 2013 8:21 PM
To: ***@yahoogroups.com
Subject: RE: RE: [seajug] JSON Schema



Definitely an interesting subject. I did think you or someone was kidding! JSON removes type safety to reduce the size of data transmitted while keeping the content in plain text, but XML wants to be self describing so is very verbose. One might prefer one solution or the other, but perhaps not both of those??
If the goals were small and type safety, and your types are set, you might like Google protocol buffers for the best of both worlds. Protocol Buffers API is implemented in many languages including javascript. :)






---In ***@yahoogroups.com, <***@...> wrote:

Interesting. I think I might have been the one who asked.

It seems like there is actually quite a lot of stuff out there in various languages around this.

Doesn't surprise me given the notion that JSON is often considered a better choice than XML, and yet there are whole industries out there still embracing XML schemas.

Dan


-----Original Message-----
From: ***@yahoogroups.com [mailto:***@yahoogroups.com] On Behalf Of ***@...
Sent: Tuesday, November 12, 2013 9:23 AM
To: ***@yahoogroups.com
Subject: [seajug] JSON Schema


Someone asked me at the meeting if there was such a thing as a JSON Schema - turns out there is (at least something early).


http://json-schema.org/



Here is a Jackson implementation:


https://github.com/FasterXML/jackson-module-jsonSchema



Haven't looked into it to see how robust, etc. But, it exists. ;)


Cheers,
-Will
k***@u.washington.edu
2013-11-13 04:36:06 UTC
Permalink
Just to repeat the message I sent which I don't see on the web interface at all:
wouldn't you say that the popularity of JSON is because thin clients need to work
around domain restrictions for same origin or lack of CORS?


There are different contexts for using JSON or using XML, specifically, thin
client or server side applications, respectively.
Google protocol buffers work in both contexts.


---In ***@yahoogroups.com, <***@...> wrote:

I can't see the message I just sent yet. I see on the web interface this from you, Daniel:
"So are you suggesting that if you want a well described format go with XML? But what if you want JSON, but would also like it to be well described? Why should JSON preclude that?"


To understand your question better, how do you use JSON?


---In ***@yahoogroups.com, <***@...> wrote:

Message So are you suggesting that if you want a well described format go with XML? But what if you want JSON, but would also like it to be well described? Why should JSON preclude that?


-----Original Message-----
From: ***@yahoogroups.com [mailto:***@yahoogroups.com] On Behalf Of ***@...
Sent: Tuesday, November 12, 2013 8:21 PM
To: ***@yahoogroups.com
Subject: RE: RE: [seajug] JSON Schema



Definitely an interesting subject. I did think you or someone was kidding! JSON removes type safety to reduce the size of data transmitted while keeping the content in plain text, but XML wants to be self describing so is very verbose. One might prefer one solution or the other, but perhaps not both of those??
If the goals were small and type safety, and your types are set, you might like Google protocol buffers for the best of both worlds. Protocol Buffers API is implemented in many languages including javascript. :)






---In ***@yahoogroups.com, <***@...> wrote:

Interesting. I think I might have been the one who asked.

It seems like there is actually quite a lot of stuff out there in various languages around this.

Doesn't surprise me given the notion that JSON is often considered a better choice than XML, and yet there are whole industries out there still embracing XML schemas.

Dan


-----Original Message-----
From: ***@yahoogroups.com [mailto:***@yahoogroups.com] On Behalf Of ***@...
Sent: Tuesday, November 12, 2013 9:23 AM
To: ***@yahoogroups.com
Subject: [seajug] JSON Schema


Someone asked me at the meeting if there was such a thing as a JSON Schema - turns out there is (at least something early).


http://json-schema.org/



Here is a Jackson implementation:


https://github.com/FasterXML/jackson-module-jsonSchema



Haven't looked into it to see how robust, etc. But, it exists. ;)


Cheers,
-Will
Daniel Kirkdorffer
2013-11-13 04:47:34 UTC
Permalink
We don't use JSON.

It does seem like it serves a very targeted role in an application, or more
specifically a Web application: as a means to transport content to and from
a client.

My question is could it become a replacement for XML in those areas people
rely on XML schemas? Is there a JSON equivalent for all the X-tech out
there around XML?

It seems that the most common response I hear to the question is "Eewwww
XML!" which doesn't quite answer the question IMO.

Dan


-----Original Message-----
From: seajug-***@public.gmane.org [mailto:seajug-***@public.gmane.org] On Behalf Of
***@u.washington.edu
Sent: Tuesday, November 12, 2013 8:30 PM
To: seajug-***@public.gmane.org
Subject: [seajug] RE: JSON Schema





I can't see the message I just sent yet. I see on the web interface this
from you, Daniel:

"So are you suggesting that if you want a well described format go with XML?
But what if you want JSON, but would also like it to be well described? Why
should JSON preclude that?"




To understand your question better, how do you use JSON?



---In seajug-***@public.gmane.org, <***@...> wrote:


So are you suggesting that if you want a well described format go with XML?
But what if you want JSON, but would also like it to be well described? Why
should JSON preclude that?




-----Original Message-----
From: seajug-***@public.gmane.org [mailto:seajug-***@public.gmane.org] On Behalf Of
***@...
Sent: Tuesday, November 12, 2013 8:21 PM
To: seajug-***@public.gmane.org
Subject: RE: RE: [seajug] JSON Schema






Definitely an interesting subject. I did think you or someone was kidding!
JSON removes type safety to reduce the size of data transmitted while
keeping the content in plain text, but XML wants to be self describing so is
very verbose. One might prefer one solution or the other, but perhaps not
both of those??

If the goals were small and type safety, and your types are set, you might
like Google protocol buffers for the best of both worlds. Protocol Buffers
API is implemented in many languages including javascript. :)









---In seajug-***@public.gmane.org, <***@...> wrote:


Interesting. I think I might have been the one who asked.

It seems like there is actually quite a lot of stuff out there in various
languages around this.

Doesn't surprise me given the notion that JSON is often considered a better
choice than XML, and yet there are whole industries out there still
embracing XML schemas.

Dan




-----Original Message-----
From: seajug-***@public.gmane.org [mailto:seajug-***@public.gmane.org] On Behalf Of
***@...
Sent: Tuesday, November 12, 2013 9:23 AM
To: seajug-***@public.gmane.org
Subject: [seajug] JSON Schema




Someone asked me at the meeting if there was such a thing as a JSON Schema -
turns out there is (at least something early).


http://json-schema.org/


Here is a Jackson implementation:

https://github.com/FasterXML/jackson-module-jsonSchema


Haven't looked into it to see how robust, etc. But, it exists. ;)

Cheers,
-Will
Nichole King
2013-11-13 08:57:07 UTC
Permalink
I think I understand your question now from the perspective of existing
APIs.

JSON is a bag of primitives or other bags. If you wanted to add the
features of XML or a typed object to it, it might not make sense, except as
requirements for well formatted data which is what it sounds like you might
be talking about.

Factual offers api access which uses JSON objects in the http get query.
Their schemas are printed tables and you can see whether a property is
faceted or not printed in a table header.

http://www.factual.com/data/t/world-geographies/schema

And they provide example use of json in their queries:

http://developer.factual.com/api-docs/

They have probably thought about your question and have an interesting
answer. It looks like for now they've decided to specify the schema in a
user readable manner.
Post by Daniel Kirkdorffer
We don't use JSON.
It does seem like it serves a very targeted role in an application, or
more specifically a Web application: as a means to transport content to and
from a client.
My question is could it become a replacement for XML in those areas people
rely on XML schemas? Is there a JSON equivalent for all the X-tech out
there around XML?
It seems that the most common response I hear to the question is
"Eewwww XML!" which doesn't quite answer the question IMO.
Dan
-----Original Message-----
*Sent:* Tuesday, November 12, 2013 8:30 PM
*Subject:* [seajug] RE: JSON Schema
"So are you suggesting that if you want a well described format go with
XML? But what if you want JSON, but would also like it to be well
described? Why should JSON preclude that?"
To understand your question better, how do you use JSON?
So are you suggesting that if you want a well described format go with
XML? But what if you want JSON, but would also like *it* to be well
described? Why should JSON preclude that?
-----Original Message-----
*Sent:* Tuesday, November 12, 2013 8:21 PM
*Subject:* RE: RE: [seajug] JSON Schema
Definitely an interesting subject. I did think you or someone was
kidding! JSON removes type safety to reduce the size of data transmitted
while keeping the content in plain text, but XML wants to be self
describing so is very verbose. One might prefer one solution or the other,
but perhaps not both of those??
If the goals were small and type safety, and your types are set, you might
like Google protocol buffers for the best of both worlds. Protocol Buffers
API is implemented in many languages including javascript. :)
Interesting. I think I might have been the one who asked.
It seems like there is actually quite a lot of stuff out there in various
languages around this.
Doesn't surprise me given the notion that JSON is often considered a
better choice than XML, and yet there are whole industries out there still
embracing XML schemas.
Dan
-----Original Message-----
*Sent:* Tuesday, November 12, 2013 9:23 AM
*Subject:* [seajug] JSON Schema
Someone asked me at the meeting if there was such a thing as a JSON Schema
- turns out there is (at least something early).
http://json-schema.org/
https://github.com/FasterXML/jackson-module-jsonSchema
Haven't looked into it to see how robust, etc. But, it exists. ;)
Cheers,
-Will
Nichole King
2013-11-13 09:02:37 UTC
Permalink
If you were interested in asking Factual for their opinion you might want
to ask Urban Airship too. They bought SimpleGeo who built the original api
that Factual offers.
Post by Nichole King
I think I understand your question now from the perspective of existing
APIs.
JSON is a bag of primitives or other bags. If you wanted to add the
features of XML or a typed object to it, it might not make sense, except as
requirements for well formatted data which is what it sounds like you might
be talking about.
Factual offers api access which uses JSON objects in the http get query.
Their schemas are printed tables and you can see whether a property is
faceted or not printed in a table header.
http://www.factual.com/data/t/world-geographies/schema
http://developer.factual.com/api-docs/
They have probably thought about your question and have an interesting
answer. It looks like for now they've decided to specify the schema in a
user readable manner.
Post by Daniel Kirkdorffer
We don't use JSON.
It does seem like it serves a very targeted role in an application, or
more specifically a Web application: as a means to transport content to and
from a client.
My question is could it become a replacement for XML in those areas
people rely on XML schemas? Is there a JSON equivalent for all the X-tech
out there around XML?
It seems that the most common response I hear to the question is
"Eewwww XML!" which doesn't quite answer the question IMO.
Dan
-----Original Message-----
*Sent:* Tuesday, November 12, 2013 8:30 PM
*Subject:* [seajug] RE: JSON Schema
I can't see the message I just sent yet. I see on the web interface this
"So are you suggesting that if you want a well described format go with
XML? But what if you want JSON, but would also like it to be well
described? Why should JSON preclude that?"
To understand your question better, how do you use JSON?
So are you suggesting that if you want a well described format go with
XML? But what if you want JSON, but would also like *it* to be well
described? Why should JSON preclude that?
-----Original Message-----
*Sent:* Tuesday, November 12, 2013 8:21 PM
*Subject:* RE: RE: [seajug] JSON Schema
Definitely an interesting subject. I did think you or someone was
kidding! JSON removes type safety to reduce the size of data
transmitted while keeping the content in plain text, but XML wants to be
self describing so is very verbose. One might prefer one solution or the
other, but perhaps not both of those??
If the goals were small and type safety, and your types are set, you
might like Google protocol buffers for the best of both worlds. Protocol
Buffers API is implemented in many languages including javascript. :)
Interesting. I think I might have been the one who asked.
It seems like there is actually quite a lot of stuff out there in various
languages around this.
Doesn't surprise me given the notion that JSON is often considered a
better choice than XML, and yet there are whole industries out there still
embracing XML schemas.
Dan
-----Original Message-----
*Sent:* Tuesday, November 12, 2013 9:23 AM
*Subject:* [seajug] JSON Schema
Someone asked me at the meeting if there was such a thing as a JSON
Schema - turns out there is (at least something early).
http://json-schema.org/
https://github.com/FasterXML/jackson-module-jsonSchema
Haven't looked into it to see how robust, etc. But, it exists. ;)
Cheers,
-Will
k***@u.washington.edu
2013-11-13 16:14:10 UTC
Permalink
I still think when you begin to step through an implementation, you'll see that you are re-doing what Google Protocol Buffers already does except that the data representation won't be smaller due to pb encoding...


---In ***@yahoogroups.com, <***@...> wrote:

If you were interested in asking Factual for their opinion you might want to ask Urban Airship too. They bought SimpleGeo who built the original api that Factual offers.
On Nov 13, 2013 12:57 AM, "Nichole King" <***@... mailto:***@...> wrote:
I think I understand your question now from the perspective of existing APIs.
JSON is a bag of primitives or other bags. If you wanted to add the features of XML or a typed object to it, it might not make sense, except as requirements for well formatted data which is what it sounds like you might be talking about.
Factual offers api access which uses JSON objects in the http get query.
Their schemas are printed tables and you can see whether a property is faceted or not printed in a table header.
http://www.factual.com/data/t/world-geographies/schema http://www.factual.com/data/t/world-geographies/schema
And they provide example use of json in their queries:
http://developer.factual.com/api-docs/ http://developer.factual.com/api-docs/
They have probably thought about your question and have an interesting answer. It looks like for now they've decided to specify the schema in a user readable manner.

On Nov 12, 2013 8:48 PM, "Daniel Kirkdorffer" <***@... mailto:***@...> wrote:

We don't use JSON.

It does seem like it serves a very targeted role in an application, or more specifically a Web application: as a means to transport content to and from a client.

My question is could it become a replacement for XML in those areas people rely on XML schemas? Is there a JSON equivalent for all the X-tech out there around XML?

It seems that the most common response I hear to the question is "Eewwww XML!" which doesn't quite answer the question IMO.

Dan


-----Original Message-----
From: ***@yahoogroups.com mailto:***@yahoogroups.com [mailto:***@yahoogroups.com mailto:***@yahoogroups.com] On Behalf Of ***@... mailto:***@...
Sent: Tuesday, November 12, 2013 8:30 PM
To: ***@yahoogroups.com mailto:***@yahoogroups.com
Subject: [seajug] RE: JSON Schema



I can't see the message I just sent yet. I see on the web interface this from you, Daniel:
"So are you suggesting that if you want a well described format go with XML? But what if you want JSON, but would also like it to be well described? Why should JSON preclude that?"


To understand your question better, how do you use JSON?


---In ***@yahoogroups.com mailto:***@yahoogroups.com, <***@...> wrote:

So are you suggesting that if you want a well described format go with XML? But what if you want JSON, but would also like it to be well described? Why should JSON preclude that?


-----Original Message-----
From: ***@yahoogroups.com mailto:***@yahoogroups.com [mailto:***@yahoogroups.com mailto:***@yahoogroups.com] On Behalf Of ***@...
Sent: Tuesday, November 12, 2013 8:21 PM
To: ***@yahoogroups.com mailto:***@yahoogroups.com
Subject: RE: RE: [seajug] JSON Schema


Definitely an interesting subject. I did think you or someone was kidding! JSON removes type safety to reduce the size of data transmitted while keeping the content in plain text, but XML wants to be self describing so is very verbose. One might prefer one solution or the other, but perhaps not both of those??
If the goals were small and type safety, and your types are set, you might like Google protocol buffers for the best of both worlds. Protocol Buffers API is implemented in many languages including javascript. :)






---In ***@yahoogroups.com mailto:***@yahoogroups.com, <***@...> wrote:

Interesting. I think I might have been the one who asked.

It seems like there is actually quite a lot of stuff out there in various languages around this.

Doesn't surprise me given the notion that JSON is often considered a better choice than XML, and yet there are whole industries out there still embracing XML schemas.

Dan


-----Original Message-----
From: ***@yahoogroups.com mailto:***@yahoogroups.com [mailto:***@yahoogroups.com mailto:***@yahoogroups.com] On Behalf Of ***@...
Sent: Tuesday, November 12, 2013 9:23 AM
To: ***@yahoogroups.com mailto:***@yahoogroups.com
Subject: [seajug] JSON Schema


Someone asked me at the meeting if there was such a thing as a JSON Schema - turns out there is (at least something early).


http://json-schema.org/ http://json-schema.org/



Here is a Jackson implementation:


https://github.com/FasterXML/jackson-module-jsonSchema https://github.com/FasterXML/jackson-module-jsonSchema



Haven't looked into it to see how robust, etc. But, it exists. ;)


Cheers,
-Will
Daniel Kirkdorffer
2013-11-13 16:27:52 UTC
Permalink
Actual "structured" data representations are what I care about. Those web pages are nice, but they don't help me programmatically. That's where JSON schema would come in.

----- Original Message -----

From: "Nichole King" <***@u.washington.edu>
To: seajug-***@public.gmane.org
Sent: Wednesday, November 13, 2013 12:57:07 AM
Subject: RE: [seajug] RE: JSON Schema






I think I understand your question now from the perspective of existing APIs.

JSON is a bag of primitives or other bags. If you wanted to add the features of XML or a typed object to it, it might not make sense, except as requirements for well formatted data which is what it sounds like you might be talking about.

Factual offers api access which uses JSON objects in the http get query.
Their schemas are printed tables and you can see whether a property is faceted or not printed in a table header.

http://www.factual.com/data/t/world-geographies/schema


And they provide example use of json in their queries:

http://developer.factual.com/api-docs/


They have probably thought about your question and have an interesting answer. It looks like for now they've decided to specify the schema in a user readable manner.
On Nov 12, 2013 8:48 PM, "Daniel Kirkdorffer" < dankirkd-***@public.gmane.org > wrote:






We don't use JSON.
It does seem like it serves a very targeted role in an application, or more specifically a Web application: as a means to transport content to and from a client.
My question is could it become a replacement for XML in those areas people rely on XML schemas? Is there a JSON equivalent for all the X-tech out there around XML?
It seems that the most common response I hear to the question is "Eewwww XML!" which doesn't quite answer the question IMO.
Dan

<blockquote>


-----Original Message-----
From: seajug-***@public.gmane.org [mailto: seajug-***@public.gmane.org ] On Behalf Of ***@u.washington.edu
Sent: Tuesday, November 12, 2013 8:30 PM
To: seajug-***@public.gmane.org
Subject: [seajug] RE: JSON Schema






I can't see the message I just sent yet. I see on the web interface this from you, Daniel:

" So are you suggesting that if you want a well described format go with XML? But what if you want JSON, but would also like it to be well described? Why should JSON preclude that?"




To understand your question better, how do you use JSON?


---In seajug-***@public.gmane.org , <***@...> wrote:

So are you suggesting that if you want a well described format go with XML? But what if you want JSON, but would also like it to be well described? Why should JSON preclude that?

<blockquote>

<blockquote>


-----Original Message-----
From: seajug-***@public.gmane.org [mailto: seajug-***@public.gmane.org ] On Behalf Of ***@...
Sent: Tuesday, November 12, 2013 8:21 PM
To: seajug-***@public.gmane.org
Subject: RE: RE: [seajug] JSON Schema






Definitely an interesting subject. I did think you or someone was kidding! JSON removes type safety to reduce the size of data transmitted while keeping the content in plain text, but XML wants to be self describing so is very verbose. One might prefer one solution or the other, but perhaps not both of those??

If the goals were small and type safety, and your types are set, you might like Google protocol buffers for the best of both worlds. Protocol Buffers API is implemented in many languages including javascript. :)







---In seajug-***@public.gmane.org , <***@...> wrote:

Interesting. I think I might have been the one who asked.
It seems like there is actually quite a lot of stuff out there in various languages around this.
Doesn't surprise me given the notion that JSON is often considered a better choice than XML, and yet there are whole industries out there still embracing XML schemas.
Dan

<blockquote>

<blockquote>


-----Original Message-----
From: seajug-***@public.gmane.org [mailto: seajug-***@public.gmane.org ] On Behalf Of ***@...
Sent: Tuesday, November 12, 2013 9:23 AM
To: seajug-***@public.gmane.org
Subject: [seajug] JSON Schema



Someone asked me at the meeting if there was such a thing as a JSON Schema - turns out there is (at least something early).

http://json-schema.org/

Here is a Jackson implementation:

https://github.com/FasterXML/jackson-module-jsonSchema

Haven't looked into it to see how robust, etc. But, it exists. ;)

Cheers,
-Will




</blockquote>


</blockquote>

</blockquote>








</blockquote>





</blockquote>
k***@u.washington.edu
2013-11-13 04:31:12 UTC
Permalink
Just re-read your email and thought your point about embracing JSON is probably due to thin client's working around same domain restrictions or lack of CORS for accessing data... fun stuff to think about...


---In ***@yahoogroups.com, <***@...> wrote:

Definitely an interesting subject. I did think you or someone was kidding! JSON removes type safety to reduce the size of data transmitted while keeping the content in plain text, but XML wants to be self describing so is very verbose. One might prefer one solution or the other, but perhaps not both of those??
If the goals were small and type safety, and your types are set, you might like Google protocol buffers for the best of both worlds. Protocol Buffers API is implemented in many languages including javascript. :)






---In ***@yahoogroups.com, <***@...> wrote:

Message Interesting. I think I might have been the one who asked.

It seems like there is actually quite a lot of stuff out there in various languages around this.

Doesn't surprise me given the notion that JSON is often considered a better choice than XML, and yet there are whole industries out there still embracing XML schemas.

Dan


-----Original Message-----
From: ***@yahoogroups.com [mailto:***@yahoogroups.com] On Behalf Of ***@...
Sent: Tuesday, November 12, 2013 9:23 AM
To: ***@yahoogroups.com
Subject: [seajug] JSON Schema


Someone asked me at the meeting if there was such a thing as a JSON Schema - turns out there is (at least something early).


http://json-schema.org/



Here is a Jackson implementation:


https://github.com/FasterXML/jackson-module-jsonSchema



Haven't looked into it to see how robust, etc. But, it exists. ;)


Cheers,
-Will
David Karr
2013-11-13 16:14:24 UTC
Permalink
If the goal is to have self-describing schema, and to also use JSON, then
you might consider this set of elements:

Use a JAX-RS implementation like CXF or Jersey. Define an XML schema for
your interface objects, and generate the JAXB-annotated classes from the
schema. Set your controllers to consume and provide JSON.

This won't let you strictly validate a JSON object against the schema, but
it does provide most of the expected semantics of a defined schema driving
the structure of JSON objects.
Post by Daniel Kirkdorffer
Interesting. I think I might have been the one who asked.
It seems like there is actually quite a lot of stuff out there in various
languages around this.
Doesn't surprise me given the notion that JSON is often considered a
better choice than XML, and yet there are whole industries out there still
embracing XML schemas.
Dan
-----Original Message-----
*Sent:* Tuesday, November 12, 2013 9:23 AM
*Subject:* [seajug] JSON Schema
Someone asked me at the meeting if there was such a thing as a JSON Schema
- turns out there is (at least something early).
http://json-schema.org/
https://github.com/FasterXML/jackson-module-jsonSchema
Haven't looked into it to see how robust, etc. But, it exists. ;)
Cheers,
-Will
k***@u.washington.edu
2013-11-13 16:31:36 UTC
Permalink
that's a helpful answer if there is a requirement to use existing infrastructure to provide ability to validate a JSON object, but it still greatly increases the cost per message...


---In ***@yahoogroups.com, <***@...> wrote:

If the goal is to have self-describing schema, and to also use JSON, then you might consider this set of elements:


Use a JAX-RS implementation like CXF or Jersey. Define an XML schema for your interface objects, and generate the JAXB-annotated classes from the schema. Set your controllers to consume and provide JSON.


This won't let you strictly validate a JSON object against the schema, but it does provide most of the expected semantics of a defined schema driving the structure of JSON objects.



On Tue, Nov 12, 2013 at 8:05 PM, Daniel Kirkdorffer <***@... mailto:***@...> wrote:

Interesting. I think I might have been the one who asked.

It seems like there is actually quite a lot of stuff out there in various languages around this.

Doesn't surprise me given the notion that JSON is often considered a better choice than XML, and yet there are whole industries out there still embracing XML schemas.

Dan


-----Original Message-----
From: ***@yahoogroups.com mailto:***@yahoogroups.com [mailto:***@yahoogroups.com mailto:***@yahoogroups.com] On Behalf Of ***@... mailto:***@...
Sent: Tuesday, November 12, 2013 9:23 AM
To: ***@yahoogroups.com mailto:***@yahoogroups.com
Subject: [seajug] JSON Schema


Someone asked me at the meeting if there was such a thing as a JSON Schema - turns out there is (at least something early).


http://json-schema.org/ http://json-schema.org/



Here is a Jackson implementation:


https://github.com/FasterXML/jackson-module-jsonSchema https://github.com/FasterXML/jackson-module-jsonSchema



Haven't looked into it to see how robust, etc. But, it exists. ;)


Cheers,
-Will
Daniel Kirkdorffer
2013-11-13 16:35:54 UTC
Permalink
Hi David,

I guess that would be one way. We're already using JAX-RS and defining our interface objects in XSD to generate the classes, so we're most of the way there. It is kind of a roundabout way to go though.

Dan


----- Original Message -----

From: "David Karr" <davidmichaelkarr-***@public.gmane.org>
To: "seajug" <seajug-***@public.gmane.org>
Sent: Wednesday, November 13, 2013 8:14:24 AM
Subject: Re: [seajug] JSON Schema




If the goal is to have self-describing schema, and to also use JSON, then you might consider this set of elements:

Use a JAX-RS implementation like CXF or Jersey. Define an XML schema for your interface objects, and generate the JAXB-annotated classes from the schema. Set your controllers to consume and provide JSON.

This won't let you strictly validate a JSON object against the schema, but it does provide most of the expected semantics of a defined schema driving the structure of JSON objects.


On Tue, Nov 12, 2013 at 8:05 PM, Daniel Kirkdorffer < dankirkd-***@public.gmane.org > wrote:






Interesting. I think I might have been the one who asked.
It seems like there is actually quite a lot of stuff out there in various languages around this.
Doesn't surprise me given the notion that JSON is often considered a better choice than XML, and yet there are whole industries out there still embracing XML schemas.
Dan

<blockquote>

-----Original Message-----
From: seajug-***@public.gmane.org [mailto: seajug-***@public.gmane.org ] On Behalf Of wiverson-***@public.gmane.org
Sent: Tuesday, November 12, 2013 9:23 AM
To: seajug-***@public.gmane.org
Subject: [seajug] JSON Schema



Someone asked me at the meeting if there was such a thing as a JSON Schema - turns out there is (at least something early).



http://json-schema.org/

Here is a Jackson implementation:

https://github.com/FasterXML/jackson-module-jsonSchema

Haven't looked into it to see how robust, etc. But, it exists. ;)

Cheers,
-Will












</blockquote>
George Smith
2013-11-13 17:36:52 UTC
Permalink
Back in the 20th century, I worked on the Open Travel Alliance
(OTA)<http://www.opentravel.org/> XML
standards committee, and was a major contributor to version 1 (to the point
that my children's names are in the document's example XML).

At this point I learned the distinction between the MOM and POP camps of
the XML community: MOM - Message oriented Middleware; POP - Presentation
oriented Publishing.
The MOM camp wanted XML to be simple and and POP camp wanted XML to be
powerful and flexible. From a MOM camp members perspective, the problem
with XML is that the POP camp WON!

In any case, in the OTA's architecture committee, there was a large debate
about the value of using validating XML parsers (w/ XML Schema just coming
out). The conclusion that a number of us came to was that:

While XML Schemas are incredibly valuable from a specification perspective,
they are almost worthless from a validation perspective!


The reasons that this conclusion was reached are as follows:
Schema validation only guarantees Syntax, and does next to nothing for
Semantics - In the MOM world (which was what the OTA was about) Semantics
are what matters!
Since the schema reference is carried in the XML, and it is this Schema
applied by the parser (as opposed to being provided to the parser by the
receiving code), it can't be trusted - if you can't trust the sender to
send appropriate XML, you can't trust the Schema reference in the XML!

IMO, the built in nature of SON on the browser, and the POP camp; has
driven the Web Services "standard" away from XML, and toward JSON.

George
Post by Daniel Kirkdorffer
Hi David,
I guess that would be one way. We're already using JAX-RS and defining
our interface objects in XSD to generate the classes, so we're most of the
way there. It is kind of a roundabout way to go though.
Dan
------------------------------
*Sent: *Wednesday, November 13, 2013 8:14:24 AM
*Subject: *Re: [seajug] JSON Schema
If the goal is to have self-describing schema, and to also use JSON, then
Use a JAX-RS implementation like CXF or Jersey. Define an XML schema for
your interface objects, and generate the JAXB-annotated classes from the
schema. Set your controllers to consume and provide JSON.
This won't let you strictly validate a JSON object against the schema, but
it does provide most of the expected semantics of a defined schema driving
the structure of JSON objects.
Post by Daniel Kirkdorffer
Interesting. I think I might have been the one who asked.
It seems like there is actually quite a lot of stuff out there in various
languages around this.
Doesn't surprise me given the notion that JSON is often considered a
better choice than XML, and yet there are whole industries out there still
embracing XML schemas.
Dan
-----Original Message-----
*Sent:* Tuesday, November 12, 2013 9:23 AM
*Subject:* [seajug] JSON Schema
Someone asked me at the meeting if there was such a thing as a JSON
Schema - turns out there is (at least something early).
http://json-schema.org/
https://github.com/FasterXML/jackson-module-jsonSchema
Haven't looked into it to see how robust, etc. But, it exists. ;)
Cheers,
-Will
--
"And the users exclaimed with a laugh and a taunt: It's just what we
asked for but not what we want." -- Unknown
k***@u.washington.edu
2013-11-13 18:56:08 UTC
Permalink
It sounds like decisions for that use of XML were made with SGML goals rather than data as part of a typed object (without behavior). Interesting stuff.


I still think any JSON you see on the server side is most likely due to a chain of use cases that may have roots in working around thin client rules regarding same origin policy and also keeping the data small on the client side.
consistent choices in the primary reasons for choosing a data encapsulation hopefully don't require wrappers that defeat the original goals, but bridges between technologies are sometimes necessary, but that's a different use case.


---In ***@yahoogroups.com, <***@...> wrote:

Back in the 20th century, I worked on the Open Travel Alliance (OTA) http://www.opentravel.org/ XML standards committee, and was a major contributor to version 1 (to the point that my children's names are in the document's example XML).

At this point I learned the distinction between the MOM and POP camps of the XML community: MOM - Message oriented Middleware; POP - Presentation oriented Publishing.
The MOM camp wanted XML to be simple and and POP camp wanted XML to be powerful and flexible. From a MOM camp members perspective, the problem with XML is that the POP camp WON!

In any case, in the OTA's architecture committee, there was a large debate about the value of using validating XML parsers (w/ XML Schema just coming out). The conclusion that a number of us came to was that:

While XML Schemas are incredibly valuable from a specification perspective, they are almost worthless from a validation perspective!


The reasons that this conclusion was reached are as follows:
Schema validation only guarantees Syntax, and does next to nothing for Semantics - In the MOM world (which was what the OTA was about) Semantics are what matters!
Since the schema reference is carried in the XML, and it is this Schema applied by the parser (as opposed to being provided to the parser by the receiving code), it can't be trusted - if you can't trust the sender to send appropriate XML, you can't trust the Schema reference in the XML!


IMO, the built in nature of SON on the browser, and the POP camp; has driven the Web Services "standard" away from XML, and toward JSON.


George









On Wed, Nov 13, 2013 at 8:35 AM, Daniel Kirkdorffer <***@... mailto:***@...> wrote:
Hi David,



I guess that would be one way. We're already using JAX-RS and defining our interface objects in XSD to generate the classes, so we're most of the way there. It is kind of a roundabout way to go though.



Dan





From: "David Karr" <***@... mailto:***@...>
To: "seajug" <***@yahoogroups.com mailto:***@yahoogroups.com>
Sent: Wednesday, November 13, 2013 8:14:24 AM
Subject: Re: [seajug] JSON Schema


If the goal is to have self-describing schema, and to also use JSON, then you might consider this set of elements:



Use a JAX-RS implementation like CXF or Jersey. Define an XML schema for your interface objects, and generate the JAXB-annotated classes from the schema. Set your controllers to consume and provide JSON.


This won't let you strictly validate a JSON object against the schema, but it does provide most of the expected semantics of a defined schema driving the structure of JSON objects.




On Tue, Nov 12, 2013 at 8:05 PM, Daniel Kirkdorffer <***@... mailto:***@...> wrote:

Interesting. I think I might have been the one who asked.

It seems like there is actually quite a lot of stuff out there in various languages around this.

Doesn't surprise me given the notion that JSON is often considered a better choice than XML, and yet there are whole industries out there still embracing XML schemas.

Dan


-----Original Message-----
From: ***@yahoogroups.com mailto:***@yahoogroups.com [mailto:***@yahoogroups.com mailto:***@yahoogroups.com] On Behalf Of ***@... mailto:***@...
Sent: Tuesday, November 12, 2013 9:23 AM
To: ***@yahoogroups.com mailto:***@yahoogroups.com
Subject: [seajug] JSON Schema



Someone asked me at the meeting if there was such a thing as a JSON Schema - turns out there is (at least something early).


http://json-schema.org/ http://json-schema.org/



Here is a Jackson implementation:


https://github.com/FasterXML/jackson-module-jsonSchema https://github.com/FasterXML/jackson-module-jsonSchema



Haven't looked into it to see how robust, etc. But, it exists. ;)


Cheers,
-Will































--
"And the users exclaimed with a laugh and a taunt: It's just what we asked for but not what we want." -- Unknown
Nichole King
2013-11-13 20:59:17 UTC
Permalink
correction: "keeping the data small in transit if plain text is needed"...
Post by k***@u.washington.edu
It sounds like decisions for that use of XML were made with SGML goals
rather than data as part of a typed object (without behavior). Interesting
stuff.
I still think any JSON you see on the server side is most likely due to a
chain of use cases that may have roots in working around thin client rules
regarding same origin policy and also keeping the data small on the client
side.
consistent choices in the primary reasons for choosing a data
encapsulation hopefully don't require wrappers that defeat the original
goals, but bridges between technologies are sometimes necessary, but that's
a different use case.
Back in the 20th century, I worked on the Open Travel Alliance (OTA)<http://www.opentravel.org/> XML
standards committee, and was a major contributor to version 1 (to the point
that my children's names are in the document's example XML).
At this point I learned the distinction between the MOM and POP camps of
the XML community: MOM - Message oriented Middleware; POP - Presentation
oriented Publishing.
The MOM camp wanted XML to be simple and and POP camp wanted XML to be
powerful and flexible. From a MOM camp members perspective, the problem
with XML is that the POP camp WON!
In any case, in the OTA's architecture committee, there was a large debate
about the value of using validating XML parsers (w/ XML Schema just coming
While XML Schemas are incredibly valuable from a specification
perspective, they are almost worthless from a validation perspective!
Schema validation only guarantees Syntax, and does next to nothing for
Semantics - In the MOM world (which was what the OTA was about) Semantics
are what matters!
Since the schema reference is carried in the XML, and it is this Schema
applied by the parser (as opposed to being provided to the parser by the
receiving code), it can't be trusted - if you can't trust the sender to
send appropriate XML, you can't trust the Schema reference in the XML!
IMO, the built in nature of SON on the browser, and the POP camp; has
driven the Web Services "standard" away from XML, and toward JSON.
George
Hi David,
I guess that would be one way. We're already using JAX-RS and defining
our interface objects in XSD to generate the classes, so we're most of the
way there. It is kind of a roundabout way to go though.
Dan
------------------------------
*Sent: *Wednesday, November 13, 2013 8:14:24 AM
*Subject: *Re: [seajug] JSON Schema
If the goal is to have self-describing schema, and to also use JSON,
Use a JAX-RS implementation like CXF or Jersey. Define an XML schema for
your interface objects, and generate the JAXB-annotated classes from the
schema. Set your controllers to consume and provide JSON.
This won't let you strictly validate a JSON object against the schema, but
it does provide most of the expected semantics of a defined schema driving
the structure of JSON objects.
Interesting. I think I might have been the one who asked.
It seems like there is actually quite a lot of stuff out there in various
languages around this.
Doesn't surprise me given the notion that JSON is often considered a
better choice than XML, and yet there are whole industries out there still
embracing XML schemas.
Dan
-----Original Message-----
*Sent:* Tuesday, November 12, 2013 9:23 AM
*Subject:* [seajug] JSON Schema
Someone asked me at the meeting if there was such a thing as a JSON Schema
- turns out there is (at least something early).
http://json-schema.org/
https://github.com/FasterXML/jackson-module-jsonSchema
Haven't looked into it to see how robust, etc. But, it exists. ;)
Cheers,
-Will
--
"And the users exclaimed with a laugh and a taunt: It's just what we
asked for but not what we want." -- Unknown
Dennis Sosnoski
2013-11-13 21:16:14 UTC
Permalink
Post by George Smith
...
At this point I learned the distinction between the MOM and POP camps
of the XML community: MOM - Message oriented Middleware; POP -
Presentation oriented Publishing.
The MOM camp wanted XML to be simple and and POP camp wanted XML to be
powerful and flexible. From a MOM camp members perspective, the
problem with XML is that the POP camp WON!
This has been a continuing sore point in working with XML. Really there
should be separate profiles for the two camps. The MOM version is much
simpler, and all the POP features just get in the way of making it work
well.
Post by George Smith
In any case, in the OTA's architecture committee, there was a large
debate about the value of using validating XML parsers (w/ XML Schema
While XML Schemas are incredibly valuable from a specification
perspective, they are almost worthless from a validation perspective!
Schema validation only guarantees Syntax, and does next to nothing for
Semantics - In the MOM world (which was what the OTA was about)
Semantics are what matters!
That's certainly true, and one reason I discourage the use of schema
validation. You can add semantics using something like Schematron, but
you're best off always validating the data in your application code.
Post by George Smith
Since the schema reference is carried in the XML, and it is this
Schema applied by the parser (as opposed to being provided to the
parser by the receiving code), it can't be trusted - if you can't
trust the sender to send appropriate XML, you can't trust the Schema
reference in the XML!
All the parsers allow you to override any schema reference in the actual
XML document (which is explicitly only a "hint", in any case), so I
can't see this as a serious issue. If you're going to validate you
specify the schema you want to use for the validation.

As for the wider issue of JSON vs. XML in web services, it looks to me
like there's a pretty stable division established - JSON has replaced
XML completely as a way of communicating between browser clients and
server, and even between many standalone applications and servers; XML
is still used for almost all communications between server-type
applications. I don't see any indication that JSON is taking over the
hard-core web services world, simply because the infrastructure for that
is all based on SOAP and XML.

- Dennis
George Smith
2013-11-13 22:36:49 UTC
Permalink
Dennis,

Re: "As for the wider issue of JSON vs. XML in web services", I guess I was
conflating the issue with my personal experiences and my reading re making
all Web Services as Restful as possible, and hence the general tilt toward
JSON for new Web Services.

As an aside, it appears to me that with the added complexity of XML (mostly
to support POP) over JSON parsing, combined with the total lack of
constraint regarding the use of dependant libraries facilitated by Maven et
all, has made my life more difficult as it appears that nearly everything
now uses nearly everything else! What ever happened to the idea that a 3rd
party library should have as SMALL an API surface as is reasonable to
provide the functionality?

George
Post by George Smith
...
At this point I learned the distinction between the MOM and POP camps of
the XML community: MOM - Message oriented Middleware; POP - Presentation
oriented Publishing.
The MOM camp wanted XML to be simple and and POP camp wanted XML to be
powerful and flexible. From a MOM camp members perspective, the problem
with XML is that the POP camp WON!
This has been a continuing sore point in working with XML. Really there
should be separate profiles for the two camps. The MOM version is much
simpler, and all the POP features just get in the way of making it work
well.
In any case, in the OTA's architecture committee, there was a large debate
about the value of using validating XML parsers (w/ XML Schema just coming
While XML Schemas are incredibly valuable from a specification
perspective, they are almost worthless from a validation perspective!
Schema validation only guarantees Syntax, and does next to nothing for
Semantics - In the MOM world (which was what the OTA was about) Semantics
are what matters!
That's certainly true, and one reason I discourage the use of schema
validation. You can add semantics using something like Schematron, but
you're best off always validating the data in your application code.
Since the schema reference is carried in the XML, and it is this Schema
applied by the parser (as opposed to being provided to the parser by the
receiving code), it can't be trusted - if you can't trust the sender to
send appropriate XML, you can't trust the Schema reference in the XML!
All the parsers allow you to override any schema reference in the actual
XML document (which is explicitly only a "hint", in any case), so I can't
see this as a serious issue. If you're going to validate you specify the
schema you want to use for the validation.
As for the wider issue of JSON vs. XML in web services, it looks to me
like there's a pretty stable division established - JSON has replaced XML
completely as a way of communicating between browser clients and server,
and even between many standalone applications and servers; XML is still
used for almost all communications between server-type applications. I
don't see any indication that JSON is taking over the hard-core web
services world, simply because the infrastructure for that is all based on
SOAP and XML.
- Dennis
--
"And the users exclaimed with a laugh and a taunt: It's just what we
asked for but not what we want." -- Unknown
Dennis Sosnoski
2013-11-13 23:18:45 UTC
Permalink
Post by George Smith
...
As an aside, it appears to me that with the added complexity of XML
(mostly to support POP) over JSON parsing, combined with the total
lack of constraint regarding the use of dependant libraries
facilitated by Maven et all, has made my life more difficult as it
appears that nearly everything now uses nearly everything else! What
ever happened to the idea that a 3rd party library should have as
SMALL an API surface as is reasonable to provide the functionality?
I agree with you completely on this one, George! I saw a recent mention
on the CXF list where one of the components was bringing in Scala,
Guava, JavAssist, Json4S and a second version of Jackson (besides the
main one used by CXF's JSON support) as runtime dependencies. This is
actually very relevant to the main topic of this thread, too, since the
feature that was bring all this in was Swagger support:
https://developers.helloreverb.com/swagger/

The dependencies have been corrected by making this an optional feature,
but it demonstrates how easily cascading dependencies can get out of
hand. Maven is a big enabler for this - it was, after all, part of what
made Maven popular.

- Dennis
k***@u.washington.edu
2013-11-14 01:34:27 UTC
Permalink
http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html


---In ***@yahoogroups.com, <***@...> wrote:

On 11/14/2013 11:36 AM, George Smith wrote:

...

As an aside, it appears to me that with the added complexity of XML (mostly to support POP) over JSON parsing, combined with the total lack of constraint regarding the use of dependant libraries facilitated by Maven et all, has made my life more difficult as it appears that nearly everything now uses nearly everything else! What ever happened to the idea that a 3rd party library should have as SMALL an API surface as is reasonable to provide the functionality?


I agree with you completely on this one, George! I saw a recent mention on the CXF list where one of the components was bringing in Scala, Guava, JavAssist, Json4S and a second version of Jackson (besides the main one used by CXF's JSON support) as runtime dependencies. This is actually very relevant to the main topic of this thread, too, since the feature that was bring all this in was Swagger support: https://developers.helloreverb.com/swagger/ https://developers.helloreverb.com/swagger/

The dependencies have been corrected by making this an optional feature, but it demonstrates how easily cascading dependencies can get out of hand. Maven is a big enabler for this - it was, after all, part of what made Maven popular.

- Dennis

Continue reading on narkive:
Loading...