hapi-server / data-specification-schema

JSON Schema for HAPI
MIT License
1 stars 0 forks source link

process to combine separate into one file #3

Open jbfaden opened 10 months ago

jbfaden commented 10 months ago

We need a process to combine separate into one file. Jon and Jeremy wrote separate schemas for about, capabilities, catalog, and info responses for the branch jon-jeremy-mess-3.0. This allowed the website jsonschemavalidator.net to be used to test responses directly, plus it is easier to work four small schemas than it is one. That said, we would also like to support Bob's format where they are all combined into one schema, not to mention that having four separate schemas requires redundant definitions for each single file.

So this process will take the four separate schemas and combine them into one, indicating where redundant parts have incorrect differences. It might also be useful to go the other way as well, since this is actually easier to code since there is no redunency to worry about.

jbfaden commented 10 months ago

I've written an Autoplot script which does the conversion from separate to one combined file. See https://github.com/hapi-server/data-specification-schema/blob/jon-jeremy-mess-3.0/misc/convertJsonSchema.jy. This has been verified, which is non-trivial because the order of a JSON Object's tags does not matter. I used https://www.jsondiff.com/.