Skip to content

Commit cc4fe38

Browse files
jscharettshamoons
authored andcommitted
Fixes issue with readOnly property (dschnelldavis#2)
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.
1 parent 08dfa29 commit cc4fe38

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/lib/src/shared/json-schema.functions.ts

+6
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,12 @@ export function updateInputOptions(layoutNode, schema, jsf) {
447447
}
448448
}
449449

450+
// Map the readOnly property from JsonSchema's camelcased to non-camelcased
451+
if (hasOwn(newOptions, 'readOnly')) {
452+
newOptions.readonly = newOptions.readOnly;
453+
delete newOptions.readOnly;
454+
}
455+
450456
// If schema type is integer, enforce by setting multipleOf = 1
451457
if (schema.type === 'integer' && !hasValue(newOptions.multipleOf)) {
452458
newOptions.multipleOf = 1;

0 commit comments

Comments
 (0)