OpenAPI FHIR resource $ref

Dear members,

The question: Do you know the URL or the way how to split Full FHIR JSON schema into multiple small files?

I’m trying to define OpenApi Schema and use fhir.schema.json as a source of references.
Example
Payload:
type: object
required:
- “resource”
properties:
resource:
anyOf:
# If you want to kill your browser: please uncomment this line
- $ref: “https://api-zedoc-docs.s3-ap-southeast-1.amazonaws.com/fhir.schema.json#/definitions/Patient
- $ref: “https://api-zedoc-docs.s3-ap-southeast-1.amazonaws.com/fhir.schema.json#/definitions/EnrollmentRequest

fhir.schema.json has 60 000 lines and when I tried to load this OpenAPI spec into the Swagger Editor (on a local machine) it crashed my browser (Chrome used 3 Gb of Ram).

I try to find FHIR JSON schema that was split into multiple small files, like defined here patient.schema.json.html and also failed.
Example
“id”: {
“description”: “The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.”,
“$ref”: “id.schema.json#/definitions/id”
},
The FileName is “id.schema.json”

The question: Do you know the URL or the way how to split Full FHIR JSON schema into multiple small files?

The challenge is that almost all FHIR resources inherit from DomainResource which contains ‘contained’ - which in turn references all resources. So, regardless of what data you’re trying to convey, all of FHIR is in scope. There’s no way to make that ‘small’ without choosing to not validate portions of your content. You’re certainly free to create a more limited schema if you are willing to trade off validation capability for smaller size, but what trade-off is going to make sense is going to vary from implementer to implementer, so there’s no ‘standard’ small set. If there’s a strong push for a very specific subset, we could look at publishing that.

The XSD have the same references yet they are published individually. Is there a reason why JSON Schemas are not published individually, or all in one as a document instead of a zip?

To be honest, I’m not sure why we bother publishing individual XSDs given that every schema depends on all of the others. Feel free to submit a change request.

Hi, did you find the way to split Full FHIR JSON schema into multiple small files? Our system is failing to parse fhir.schema.json because of large size, then I looking for some solution.