An attempt to give slightly more helpful error messages when we have a problem
parsing an event schema file (in particular, which file contains the problem,
and which property within it).
A bit of light refactoring to make it tractable.
I want to change the URLs for the spec sections on the website from
<version>/<section>.html to <section>/<version>.html, to better reflect how we
do the versioning.
This puts each bit of spec in its own directory, updates the index to point to
the right place, and fixes continuserv to deal with directories as well as
files.
This will probably require fixes to the speculator too, but I'll have to come
back to that.
Replace a whole bunch of special-casing for POST body parameters with the same
logic as is used for response objects: represent all but the top-level as
tables.
The 'typeof' info on the events was perpetrated by a fearsome hack which I
broke. I don't want to fix it any better right now, so just make the hack work
and pull the rug over.
Move 'inherit_parents' calls up to before get_json_schema_object_fields so that
things can inherit their types via allOf declarations. Also make it possible to
inherit descriptions.
Remove redundant 'include_parents' parameter, which was never used.
Move 'resolve_references' call out of get_tables_for_schema (it was redundant
sometimes and not others, and now it is clearer who has responsibility for it)
As a side effect, I got rid of all of the horrible symlinks and just put
in all of the proper relative paths. Because the horrible symlinks were
horrible.
A bunch of related fixes to the code for parsing the state and API yaml files:
1. Some of our objects are {key: {key: value}} - style nested key/value
dictionaries. Handle this by refactoring get_json_schema_object_fields so
that such objects are handled wherever they appear, rather than when they
are just subproperties of a 'proper' object.
2. Fix multi-level inheritance (so an object can have an 'allOf' property which
can successfully refer to an object which itself has an 'allOf' property).
3. $ref fields in event schemas weren't being expanded correctly
4. sort type tables breadth-first rather than depth-first so that the ordering
in complex structures like the /sync response makes a bit more sense.