Validating schema at all levels

179 views
Skip to first unread message

Trond Husø

unread,
May 9, 2018, 4:12:31 AM5/9/18
to JSON Schema
Dear list,

As this is my first post, let me introduce myself: I am a Norwegian developer who is also a member of the organization IPTC. We are currently working on a standard for sports data. Because we have been working on the XML standard for years, we have decided to make the JSON-standard as close to the XML-standard as possible.
This may not be the right way to do it, but as we see it there are benefits: 
1) We can reuse documentation
2) Developers of applications delivering sports data using our standards can reuse code (I've done this in a C# application I developed a few years back).

We have created a JSON-schema and we do think it is quite good, just that it does only validate the first level - or so it seems.

We are also trying to figure out how to do something like the following:
In the structure at the end of this post we have a sportsContent - we want this to be mandatory. Then we have a tournament and below this one the tournamentMetadata (TM). At the same level we have tournamentDivision (TD). TD may occur so we cannot make it mandatory, but if it is present we would like the schema to validate it and the structure following.

Our schema can be found here:
https://github.com/iptc/sportsjs-dev (We are using draft 04) 

Looking forward to some feedback from the group/list.

Best regards,

Trond

{
  "sportsContent": {
    "tournament": {
      "class": "johan",
      "tournamentMetadata": {
        "Status": "speventstatus:post-event",
        "StartDateTime": "2015-03-08",
        "VenueType": "spsitestyle:outdoor",
        "SurfaceType": "vendst:snow",
        "name": {
          "full": "Vasaloppet 2015"
        },
        "Site": {
          "SiteMetadata": {
            "HomeLocation": {
              "POIDetails": {
                "Address": {
                  "Locality": {
                    "name": {
                      "full": "Mora"
                    }
                  },
                  "Country": {
                    "name": {
                      "full": "Sverige"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "tournamentDivision" : {
        "tournamentDivisionMetadata": {
          "name": {
            "full": "Division name"
          }
        }
      }
    }
  }
}

xmlbuddy

unread,
Jun 22, 2018, 5:45:02 AM6/22/18
to JSON Schema
Hi trond!

This is quite a huge JSON schema. Is it still active?

Kind regards
Clemens

Trond Husø

unread,
Jun 27, 2018, 8:55:50 AM6/27/18
to json-...@googlegroups.com

Hi Clemens!

Thanks for reaching out

 

It is active. Both in development and to be used/implemented by anyone who would like to provide sports data in json format.

 

We are currently trying to

  1. Make sure validation work
  2. Create documentation based on the description property in the schema

 

 

Trond

--
You received this message because you are subscribed to the Google Groups "JSON Schema" group.
To unsubscribe from this group and stop receiving emails from it, send an email to json-schema...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

xmlbuddy

unread,
Jun 27, 2018, 9:34:35 AM6/27/18
to JSON Schema
Hi Trond! Nice to hear.

Maybe you want to upload the schemas also to http://schemastore.org/json/ ? I was not able to find them there.
I had to fix a small issue with the (actually optional) date-time format validation in my editor/validator but the samples are validating fine.

What requirements do you have on generating the schema documentation? I would like to learn how I could improve this feature in JSONBuddy. Currently, it is supported to generate a tree structure diagram as HTML from the JSON schema (using SVG).

Kind regards
Clemens





Am Mittwoch, 9. Mai 2018 10:12:31 UTC+2 schrieb Trond Husø:
Reply all
Reply to author
Forward
0 new messages