Re: [json-schema] Re: Use of JSON Schema as a Modeling Language

70 views
Skip to first unread message

Simon Heimler

unread,
Jul 20, 2015, 4:34:47 AM7/20/15
to json-...@googlegroups.com, michae...@gmail.com
Hello,

I've published my thesis now. In case someone's interested: 


Best,
Simon

2015-07-10 3:35 GMT+02:00 Jason Desrosiers <jdes...@gmail.com>:
Ralf,

I certainly have some opinions on most of these issues. I will look for the separate threads and post my comments there.

Jason


On Thursday, July 9, 2015 at 10:04:46 AM UTC-7, Ralf Handl wrote:

Hi Jason,

 

I'm working together with Mike Pizzo on the OASIS OData standard.

 

When mapping OData entity data models into JSON Schema we basically face to categories of problems:

  • OData concepts that don't have a counterpart in JSON Schema
  • OData concepts that can be translated into JSON Schema but are hard to recognize and translate back into OData concepts

 

The obvious solution to both problems is to introduce additional keywords to represent the OData concepts, but:

  • We have to hope that OData-agnostic JSON Schema consumers gracefully ignore the addiional keywords
  • If they ignore the missing net new concepts, we get less out of these generic JSON Schema consumers than we would like, especially from validators
  • Redundant representation of overlapping concepts bloats the schema documents

 

Missing concepts:

  • Inheritance
  • Abstract structured types
  • Keys for structured types
  • Relationships between keyed structured types

 

Hard-to-recognize concepts

  • Nullable
  • Primitive types
  • Primitive type facets

 

I'll start a separate thread for each of these topics and am looking forward to feedback and recommendations.

 

Thanks in advance!

 

Ralf Handl

Co-Chair, OASIS Odata Technical Committee



On Tuesday, June 23, 2015 at 10:08:17 PM UTC+2, Jason Desrosiers wrote:
Hi Mike,

JSON-Schema is very useful for data modeling.  In fact, JSON-Schema is more of a data modeling tool than a validation tool.  The validation features are actually quite basic.  One limitation for example is the inability to validate a value based on another value.  This means, you couldn't enforce something, "like the value of `startDate` must be less than the value of `endDate`".  The best JSON-Schema can do is enforce that `startDate` and `endDate` are both dates.

My guess would be that the issues you have run into are more about being new to JSON-Schema than they are about it's limitations. If you can provide some detail about what issues you are running into, I'm sure we can help you get past them.  If you do have a situation JSON-Schema can't describe, then it would help us to know about it so we can improve the specification to cover that edge case.

Jason

On Monday, June 22, 2015 at 5:21:45 AM UTC-7, michae...@gmail.com wrote:

Dear JSON Schema Community;

 

On behalf of the OASIS OData technical committee, I would like to understand from the experts whether or not JSON Schema is appropriate for our particular use case.

 

OData is an OASIS standard that defines an interoperable protocol for clients to interact with RESTful services in a completely generic manner.

 

An important part of the protocol is the ability to describe the resources exposed by the service. OData uses an entity-relationship data model for describing these resources, and has defined an XML-based representation of this common data model (known as "CSDL").

 

OData uses a JSON representation for data payloads, and together with the growing popularity of JSON/Javascript clients, the OASIS OData Technical Committee (TC) has gotten numerous requests to provide a JSON representation of the data model as well.

 

Given the significant overlap between describing a data model and validating the JSON payload returned from requests against the data model it is very tempting to use JSON Schema for both. In fact, we've seen other REST APIs, such as the DMTF "Redfish" specification, attempt to use JSON Schema to describe their resource model. However, in attempting to use JSON Schema to describe our data model we've run into a few issues that have caused us to question whether modeling is an appropriate use of JSON Schema.

 

So our primary question to the community is this:


Is JSON-Schema intended to be used for data modeling, or should we invest in an alternate "JSON Modeling" language that we would have first-class representation of concepts such as inheritance and relationships, and from which we could generate JSON Schema for validation?

 

We eagerly await your guidance in this area.


Thanks in advance,

 

Mike Pizzo

Editor, OASIS OData Technical Committee

--
You received this message because you are subscribed to a topic in the Google Groups "JSON Schema" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/json-schema/jcIq-OXkTJ0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to json-schema...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages