@ghentcdh/crouton-api 0.0.1-alpha.16 → 0.0.1-alpha.18

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.
package/dist/index.cjs CHANGED
@@ -3025,6 +3025,13 @@ var buildView = /* @__PURE__ */ __name((schema, columns, visible, buildUiSchema,
3025
3025
  allowAdditionalProperties(jsonSchema);
3026
3026
  dropNullableFromRequired2(jsonSchema);
3027
3027
  enforceRequiredMinLength(jsonSchema);
3028
+ if (schemaVisible) {
3029
+ const nonEditableIds = new Set(schemaCols.filter((c) => c.createable === false && c.updateable === false).map((c) => c.id));
3030
+ const required = jsonSchema["required"];
3031
+ if (Array.isArray(required) && nonEditableIds.size) {
3032
+ jsonSchema["required"] = required.filter((k) => !nonEditableIds.has(k));
3033
+ }
3034
+ }
3028
3035
  return {
3029
3036
  json_schema: jsonSchema,
3030
3037
  ui_schema: buildUiSchema(visibleCols),