@nolwenture/formik-jsonschema-form 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,17 @@
1
1
  import { solveReferences } from "./solveReferences";
2
+ let schemaDefinitions = {};
2
3
  export function createInitialValues(schema) {
3
4
  if (!schema) {
4
5
  return {};
5
6
  }
7
+ if (schema.definitions) {
8
+ schemaDefinitions = schema.definitions;
9
+ }
6
10
  if (schema.properties) {
7
11
  return Object.keys(schema === null || schema === void 0 ? void 0 : schema.properties).reduce((acc, key) => {
8
12
  var _a;
9
13
  const value = (_a = schema === null || schema === void 0 ? void 0 : schema.properties) === null || _a === void 0 ? void 0 : _a[key];
10
- const solvedValue = solveReferences(value, schema.definitions);
14
+ const solvedValue = solveReferences(value, schemaDefinitions);
11
15
  return Object.assign(Object.assign({}, acc), { [key]: createInitialValues(solvedValue) });
12
16
  }, {});
13
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nolwenture/formik-jsonschema-form",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "Formik form generation from json schema",
5
5
  "author": "Antti Vikman <antti.vikman@nolwenture.com>",
6
6
  "contributors": [