dist/@ajsf/core/esm2015/lib/json-schema-form.component.js
/**
     * 'initializeSchema' function
     *
     * Initialize 'schema'
     * Use first available input:
     * 1. schema - recommended / Angular Schema Form style
     * 2. form.schema - Single input / JSON Form style
     * 3. JSONSchema - React JSON Schema Form style
     * 4. form.JSONSchema - For testing single input React JSON Schema Forms
     * 5. form - For testing single schema-only inputs
     *
     * ... if no schema input found, the 'activateForm' function, below,
     *     will make two additional attempts to build a schema
     * 6. If layout input - build schema from layout
     * 7. If data input - build schema from data
     */
'initializeSchema' function
Initialize 'schema'
Use first available input:
1. schema - recommended / Angular Schema Form style
2. form.schema - Single input / JSON Form style
3. JSONSchema - React JSON Schema Form style
4. form.JSONSchema - For testing single input React JSON Schema Forms
5. form - For testing single schema-only inputs

if no schema input found, the 'activateForm' function, below,
will make two additional attempts to build a schema
6. If layout input - build schema from layout
7. If data input - build schema from data
' initializeSchema ' function Initialize ' schema ' Use first available input : 1 . schema - recommended / Angular Schema Form style 2 . form . schema - Single input / JSON Form style 3 . JSONSchema - React JSON Schema Form style 4 . form . JSONSchema - For testing single input React JSON Schema Forms 5 . form - For testing single schema - only inputs if no schema input found the ' activateForm ' function below will make two additional attempts to build a schema 6 . If layout input - build schema from layout 7 . If data input - build schema from data
initializeSchema() {
        if (isObject(this.schema)) {
            this.jsf.AngularSchemaFormCompatibility = true;
            this.jsf.schema = cloneDeep(this.schema);
        }
        else if (hasOwn(this.form, 'schema') && isObject(this.form.schema)) {
            this.jsf.schema = cloneDeep(this.form.schema);
        }
        else if (isObject(this.JSONSchema)) {
            this.jsf.ReactJsonSchemaFormCompatibility = true;
            this.jsf.schema = cloneDeep(this.JSONSchema);
        }
        else if (hasOwn(this.form, 'JSONSchema') && isObject(this.form.JSONSchema)) {
            this.jsf.ReactJsonSchemaFormCompatibility = true;
            this.jsf.schema = cloneDeep(this.form.JSONSchema);
        }
        else if (hasOwn(this.form, 'properties') && isObject(this.form.properties)) {
            this.jsf.schema = cloneDeep(this.form);
        }
        else if (isObject(this.form)) {
        }
        if (!isEmpty(this.jsf.schema)) {
            if (inArray('object', this.jsf.schema.type)) {
                this.jsf.schema.type = 'object';
            }
            if (hasOwn(this.jsf.schema, 'type') && this.jsf.schema.type !== 'object') {
                this.jsf.schema = {
                    'type': 'object',
                    'properties': { 1: this.jsf.schema }
                };
                this.objectWrap = true;
            }
            else if (!hasOwn(this.jsf.schema, 'type')) {
                if (isObject(this.jsf.schema.properties) ||
                    isObject(this.jsf.schema.patternProperties) ||
                    isObject(this.jsf.schema.additionalProperties)) {
                    this.jsf.schema.type = 'object';
                }
                else {
                    this.jsf.JsonFormCompatibility = true;
                    this.jsf.schema = {
                        'type': 'object',
                        'properties': this.jsf.schema
                    };
                }
            }
            this.jsf.schema = convertSchemaToDraft6(this.jsf.schema);
            this.jsf.compileAjvSchema();
            this.jsf.schema = resolveSchemaReferences(this.jsf.schema, this.jsf.schemaRefLibrary, this.jsf.schemaRecursiveRefMap, this.jsf.dataRecursiveRefMap, this.jsf.arrayMap);
            if (hasOwn(this.jsf.schemaRefLibrary, '')) {
                this.jsf.hasRootReference = true;
            }
        }
    }
initializeSchema ( ) { if ( isObject ( this . schema ) ) { this . jsf . AngularSchemaFormCompatibility = true ; this . jsf . schema = cloneDeep ( this . schema ) ; } else if ( hasOwn ( this . form , 'schema' ) && isObject ( this . form . schema ) ) { this . jsf . schema = cloneDeep ( this . form . schema ) ; } else if ( isObject ( this . JSONSchema ) ) { this . jsf . ReactJsonSchemaFormCompatibility = true ; this . jsf . schema = cloneDeep ( this . JSONSchema ) ; } else if ( hasOwn ( this . form , 'JSONSchema' ) && isObject ( this . form . JSONSchema ) ) { this . jsf . ReactJsonSchemaFormCompatibility = true ; this . jsf . schema = cloneDeep ( this . form . JSONSchema ) ; } else if ( hasOwn ( this . form , 'properties' ) && isObject ( this . form . properties ) ) { this . jsf . schema = cloneDeep ( this . form ) ; } else if ( isObject ( this . form ) ) { } if ( ! isEmpty ( this . jsf . schema ) ) { if ( inArray ( 'object' , this . jsf . schema . type ) ) { this . jsf . schema . type = 'object' ; } if ( hasOwn ( this . jsf . schema , 'type' ) && this . jsf . schema . type !== 'object' ) { this . jsf . schema = { 'type' : 'object' , 'properties' : { 1 : this . jsf . schema } } ; this . objectWrap = true ; } else if ( ! hasOwn ( this . jsf . schema , 'type' ) ) { if ( isObject ( this . jsf . schema . properties ) || isObject ( this . jsf . schema . patternProperties ) || isObject ( this . jsf . schema . additionalProperties ) ) { this . jsf . schema . type = 'object' ; } else { this . jsf . JsonFormCompatibility = true ; this . jsf . schema = { 'type' : 'object' , 'properties' : this . jsf . schema } ; } } this . jsf . schema = convertSchemaToDraft6 ( this . jsf . schema ) ; this . jsf . compileAjvSchema ( ) ; this . jsf . schema = resolveSchemaReferences ( this . jsf . schema , this . jsf . schemaRefLibrary , this . jsf . schemaRecursiveRefMap , this . jsf . dataRecursiveRefMap , this . jsf . arrayMap ) ; if ( hasOwn ( this . jsf . schemaRefLibrary , '' ) ) { this . jsf . hasRootReference = true ; } } }
'initializeSchema' function
 Initialize 'schema'
 Use first available input:
 1. schema - recommended / Angular Schema Form style
 2. form.schema - Single input / JSON Form style
 3.
' initializeSchema ' function Initialize ' schema ' Use first available input : 1 . schema - recommended / Angular Schema Form style 2 . form . schema - Single input / JSON Form style 3 .
// TODO: update to allow non-object schemas // TODO: Handle other types of form input // If other types also allowed, render schema as an object // Wrap non-object schemas in object. // Add type = 'object' if missing // Fix JSON schema shorthand (JSON Form style) // If needed, update JSON Schema to draft 6 format, including // draft 3 (JSON Form style) and draft 4 (Angular Schema Form style) // Initialize ajv and compile schema // Create schemaRefLibrary, schemaRecursiveRefMap, dataRecursiveRefMap, & arrayMap // TODO: (?) Resolve external $ref links // // Create schemaRefLibrary & schemaRecursiveRefMap // this.parser.bundle(this.schema) //   .then(schema => this.schema = resolveSchemaReferences( //     schema, this.jsf.schemaRefLibrary, //     this.jsf.schemaRecursiveRefMap, this.jsf.dataRecursiveRefMap //   ));