Advices on special json format/doc

14 views
Skip to first unread message

golfml

unread,
Apr 20, 2016, 12:35:26 PM4/20/16
to JSON Schema
Hello,

I struggle a bit on a type of document structure:

{"full_count":8394,"version":4
,"93afc49":["406132",51.0719,2.1614,99,33350,472,"0277","T-EGLC1","A319","G-EZFP",1459154949,"LGW","PRG","U25493",0,1280,"EZY46HM",0]
,"93afc7f":["471F86",52.3262,2.2503,81,35275,475,"0744","F-EHAM2","A320","HA-LYK",1459154951,"LTN","GDN","W61602",0,832,"WZZ1600",0]
,"93af010":["4B17A4",50.1278,2.2607,323,24075,359,"3035","F-LFSR2","RJ1H","HB-IYU",1459154951,"ZRH","LCY","LX460",0,-1216,"SWR45T",0]
,"93af82d":["484004",54.9297,2.3104,341,30000,531,"2177","F-EGXH1","B744","PH-BFE",1459154951,"AMS","IAH","KL661",0,-64,"KLM25",0]
}

This is just en excerpt of a larger json doc. The doc is valid. The same line as of the last four lines repeat for a few dozen of times, I just show 4. There is no relation between the  full_count value and the number of lines in the document.

How can I write a schema for this type of doc?

I would be able to do it if the data lines that appear after the first two elements were enclosed in a named array:  "data":[ ... ].
But there is not such a construct. So how can I create a schema for this, and validate the doc against the schema?

Many thanks for your help and advices.

Best regards.

P.


Chris Miles

unread,
Apr 21, 2016, 7:29:24 AM4/21/16
to json-...@googlegroups.com
items is an array of types. With tuple validation you define the sequence you want, e.g.
"items":[
{"type":"string"},
{"type":"number"},
{"type":"number"}
]

hth,
  Chris
--
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.

The information contained in this email, including any attachments, is intended solely for use by the individual or entity named above and may be confidential. If you have received this email in error please delete it and notify the sender immediately; you should not retain the message or disclose its contents to anyone. Thank you. Yell is a brand of hibu (UK) Limited. Registered Office: One Reading Central, Forbury Road, Reading, Berkshire, RG1 3YL. Registered in England and Wales No. 4205228” VAT Number: GB 765 346 017 © hibu (UK) Limited 2016. All rights reserved. Yell, Yellow Pages, hibu and other TM are trademarks of hibu.
Reply all
Reply to author
Forward
0 new messages