I was able to rudimentarily implement the FHIR JSON schemata available at http://build.fhir.org/definitions.json.zip
Unfortunately, it took a few transformation scripts that removed the id at the base of the schema (e.g.
"id": "http://hl7.org/fhir/json-schema/Account") and modifying
$ref to a local server with the schemata. Since
id doesn’t link to a real resource on the web, my validator is throwing an exception.
Is the source to generate the JSON schemata publicly available somewhere?
well, the source is in FHIR SVN: org.hl7.fhir.definitions.generators.specification.json.SchemaGenerator - but before we start talking about changes to that, we need more context - in what tool did the problem surface? what was the set up? we’ve already had discussions about these things, and changed some of them
in what tool did the problem surface? what was the set up?
I’m using ex_json_schema, which is a JSON schema validator for Elixir.
First the validator accepts a schema that is provided locally (e.g. I run
File.read!('definitions/schema/Organization.schema.json') |> Poison.decode! 1). The validator was requesting http://hl7.org/fhir/json-schema/Organization (since that is what is in the
"id" field for the schema) and failing because that resource isn’t actually there (http code 404).
To fix this issue, I removed the
"id" field and appended the local server to the front of the
$ref and was able to resolve the schema.
My assumption is that the aforementioned Elixir JSON schema validator has a bug, since the
$refs should theoretically work.
we’ve already had discussions about these things, and changed some of them
I don’t think any changes would be necessary. You’ve given me everything I need to be able to modify the schemata
id to fix the issue. What I plan to do is make the
$refs relative again and then replace the
id with the correct server address to request each schema.
 This reads the file into memory and then parses the JSON into a data structure that Elixir can process.