superside-oss / sanity-copy-paste

MIT License
8 stars 1 forks source link

Property value missing _type #6

Open loayawad opened 6 months ago

loayawad commented 6 months ago

I get this error when I copy/paste a component. I tried to include it with different field types, but doesn't work, am I doing something wrong?

Screenshot 2024-03-26 at 15 54 32

The code

name: "values",
type: "array",
title: "Values",
of: [
        {
          type: "object",
          title: "Section",
          fields: [
            defineField(copyPaste),
            {
              name: "title",
              type: "string",
              title: "Title",
              validation: (Rule) => Rule.required(),
            },
            {
              name: "paragraphs",
              type: "array",
              title: "Paragraphs",
              of: [
                {
                  type: "string",
                },
              ],
              validation: (Rule) =>
                Rule.required()
                  .min(1)
                  .error("At least one paragraph is required."),
            },
          ],
        },
      ],