Skip to content

Commit

Permalink
fix(api-headless-cms): validate model import (#4194)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunozoric authored Jul 5, 2024
1 parent bd89ca2 commit f98670e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const fieldSchema = zod.object({
renderer: zod
.object({
name: shortString,
settings: zod.object({}).passthrough().optional()
settings: zod.object({}).passthrough().nullish().optional()
})
.optional()
.nullable()
Expand Down
3 changes: 2 additions & 1 deletion packages/api-headless-cms/src/types/modelField.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { CmsModel } from "./model";
import { GenericRecord } from "@webiny/api/types";

export type CmsModelFieldType =
| "boolean"
Expand Down Expand Up @@ -258,7 +259,7 @@ interface CmsModelFieldRenderer {
/**
* Renderer settings allow you to configure field renderer on a field level.
*/
settings?: Record<string, any>;
settings?: GenericRecord<string> | null;
}

/**
Expand Down

0 comments on commit f98670e

Please sign in to comment.