Skip to content

Commit 073b98e

Browse files
committed
Don't assume schema types will be passed to defaultForm
1 parent 834a719 commit 073b98e

File tree

3 files changed

+204
-197
lines changed

3 files changed

+204
-197
lines changed

bundle.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/*!
22
* json-schema-form
33
* @version 1.0.0-alpha.1
4+
* @link https://github.com/json-schema-form/json-schema-form-core
45
* @license MIT
5-
* Copyright 2016 JSON Schema Form
6+
* Copyright (c) 2016 JSON Schema Form
67
*/
78
(function webpackUniversalModuleDefinition(root, factory) {
89
if(typeof exports === 'object' && typeof module === 'object')
@@ -766,6 +767,7 @@ return /******/ (function(modules) { // webpackBootstrap
766767
var _ret = function () {
767768
var f = stdFormObj(name, schema, options);
768769
f.type = 'fieldset';
770+
f.key = options.path;
769771
f.items = [];
770772
options.lookup[(0, _sfPath.stringify)(options.path)] = f;
771773

@@ -839,8 +841,7 @@ return /******/ (function(modules) { // webpackBootstrap
839841
number: [number],
840842
integer: [integer],
841843
boolean: [checkbox],
842-
array: [array],
843-
defaultForm: defaultForm
844+
array: [checkboxes, array]
844845
};
845846
};
846847

@@ -852,6 +853,7 @@ return /******/ (function(modules) { // webpackBootstrap
852853
var lookup = {}; //Map path => form obj for fast lookup in merging
853854
ignore = ignore || {};
854855
globalOptions = globalOptions || {};
856+
defaultSchemaTypes = defaultSchemaTypes || createDefaults();
855857

856858
if (schema.properties) {
857859
Object.keys(schema.properties).forEach(function (key) {

lib/schemaDefaults.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export function fieldset(name, schema, options, defaultFormDef) {
159159
if (stripNullType(schema.type) === 'object') {
160160
const f = stdFormObj(name, schema, options);
161161
f.type = 'fieldset';
162-
f.key = options.path;
162+
f.key = options.path;
163163
f.items = [];
164164
options.lookup[stringify(options.path)] = f;
165165

@@ -231,8 +231,7 @@ export function createDefaults() {
231231
number: [ number ],
232232
integer: [ integer ],
233233
boolean: [ checkbox ],
234-
array: [ array ],
235-
defaultForm: defaultForm
234+
array: [ checkboxes, array ]
236235
};
237236
};
238237

@@ -244,6 +243,7 @@ export function defaultForm(schema, defaultSchemaTypes, ignore, globalOptions) {
244243
const lookup = {}; //Map path => form obj for fast lookup in merging
245244
ignore = ignore || {};
246245
globalOptions = globalOptions || {};
246+
defaultSchemaTypes = defaultSchemaTypes || createDefaults();
247247

248248
if (schema.properties) {
249249
Object.keys(schema.properties).forEach((key) => {

0 commit comments

Comments
 (0)