Create a registry of UISchemaElements for all definitions in a schema.

The UISchemaElements are created with a stub layout that includes a control for the "@id" and "@type" properties. The tester for the UISchemaElements checks whether the "@type" property is equal to the IRI of the definition.

This utility function makes it easy to use definitions in a JSON Schema by default as a relationship between entities. Normaly a definition is just resolved to it's schema and treated as a normal object or array without any special handling.

  • Parameters

    • schema: JSONSchema7

      The schema to create UISchemaElements for.

    • Optionaloptions: CreateUISchemataOptions

      Options for the creation of the UISchemaElements.

      • rank

        The rank to assign to the UISchemaElements in the registry. Higher ranks are preferred. Default is 10.

      • typeNameLabelMap

        A map from definition names to labels to use for the controls.

      • typeNameUiSchemaOptionsMap

        A map from definition names to additional UI schema options.

      • definitionToTypeIRI

        A function that converts a definition name to an IRI for the type.

      • makeUiSchemaOptions

        A function that creates UI schema options for a definition.

      • excludeDefinitions

        An array of definition names to exclude from the registry.

    Returns {
        registry: JsonFormsUISchemaRegistryEntry[];
        uiSchemata: Record<string, UISchemaElement>;
    }

    A registry of UISchemaElements and a map of UISchemaElements by definition name.