serializr
    Preparing search index...

    Function list

    • List indicates that this property contains a list of things. Accepts a sub model schema to serialize the contents

      Parameters

      • propSchema: PropSchema

        to be used to (de)serialize the contents of the array

      • OptionaladditionalArgs: AdditionalPropArgs

        optional object that contains beforeDeserialize and/or afterDeserialize handlers

      Returns PropSchema

      class SubTask {}
      class Task {}
      class Todo {}

      createModelSchema(SubTask, {
      title: true,
      })
      createModelSchema(Todo, {
      title: true,
      subTask: list(object(SubTask)),
      })

      const todo = deserialize(Todo, {
      title: 'Task',
      subTask: [
      {
      title: 'Sub task 1',
      },
      ],
      })