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:
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.
{ "title": "Location", "description": "Location where hardware is deployed", "properties": [ { "$extend": "/field/streetAdress" }, { "$extend": "/field/streetNumber" }, { "$extend": "/field/town" }, { "$extend": "/field/country" } ], "required": [ "streetAdress", "streetNumber", "town" ], "smw_prefix": { "header": 1, "wikitext": "Some prefix-description for the location" }, "smw_postfix": { "wikitext": "Some postfix-description for the location" }}
title: Locationdescription: Location where hardware is deployed
items: - $extend: /field/streetAdress - $extend: /field/streetNumber - $extend: /field/town - $extend: /field/country
required: - streetAdress - streetNumber - town
- $extend: /smw_template/NetworkPrinterHeader
showForm: true
{
"$extend": "/smw_template/NetworkPrinterHeader",
"showForm": true
}
{
"allOf": [{ "$ref": "/smw_template/NetworkPrinterHeader" }],
"showForm": true
}
...
Hi Jason,
I'm working together with Mike Pizzo on the OASIS OData technical committee.
Some of the problems we face are around the primitive types.
OData's set of primitive types originate from common database and programming language data types, see http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397943, e.g. Edm.Int64, Edm.Date, or Edm.Double. The corresponding JSON Schema primitive types are typically broader in scope, and the OData primitive types imply additional restrictions on the serialization or recommended internal representation for data consumers.
This could be represented via new format attributes, e.g. "date" for OData's Edm.Date primitive type, and we've seen that e.g. Swagger goes into that direction, defining a few additional format attributes that match our needs ("date", "int64", "int32").
Is this the right way to go? If yes: with "neutral" attribute names, e.g. "duration" for duration values, matching the predefined ones in style, or with "distinctive" names, e.g. "xs:dayTimeDuration", to avoid possible conflicts with other parties adding format attributes?
Thanks in advance!
Ralf Handl
Co-Chair, OASIS Odata Technical Committee
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:
The obvious solution to both problems is to introduce additional keywords to represent the OData concepts, but:
Missing concepts:
Hard-to-recognize concepts
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