From 717d5ef194e697fa90c804ae377d279d64012612 Mon Sep 17 00:00:00 2001 From: James Scharett Date: Wed, 14 Feb 2018 09:47:56 -0500 Subject: [PATCH] Fixes issue with readOnly property JsonSchema specifies that the readOnly property be camel-case, so we need to map that over to the lower case javascript property that is used internally. --- src/lib/src/shared/json-schema.functions.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/src/shared/json-schema.functions.ts b/src/lib/src/shared/json-schema.functions.ts index 7ec27d9c..78b727a6 100755 --- a/src/lib/src/shared/json-schema.functions.ts +++ b/src/lib/src/shared/json-schema.functions.ts @@ -447,6 +447,12 @@ export function updateInputOptions(layoutNode, schema, jsf) { } } + // Map the readOnly property from JsonSchema's camelcased to non-camelcased + if (hasOwn(newOptions, 'readOnly')) { + newOptions.readonly = newOptions.readOnly; + delete newOptions.readOnly; + } + // If schema type is integer, enforce by setting multipleOf = 1 if (schema.type === 'integer' && !hasValue(newOptions.multipleOf)) { newOptions.multipleOf = 1;