Skip to main content

isolated_schema

Function isolated_schema 

Source
pub fn isolated_schema(
    schema_loc: &str,
    sd: &StructureDefinition,
) -> Result<Value, OperationOutcomeError>
Expand description

Generates an isolated JSON Schema from a FHIR [StructureDefinition].

Traverses the structure definition and converts leaf elements into primitive schemas and complex elements into nested schemas. Returns an OperationOutcomeError if traversal fails or no schema can be generated.

§Arguments

  • schema_loc - The location used when generating the schema.
  • sd - The FHIR [StructureDefinition] to convert.

§Errors

Returns an OperationOutcomeError if the structure definition cannot be traversed or does not produce a schema.