Function alias

  • Alias indicates that this model property should be named differently in the generated json. Alias should be the outermost propschema.

    Example

    createModelSchema(Todo, {
    title: alias('task', primitive()),
    })

    serialize(new Todo('test')) // { "task": "test" }

    Parameters

    • name: string

      name of the json field to be used for this property

    • Optional propSchema: PropDef

      propSchema to (de)serialize the contents of this field

    Returns PropSchema

Generated using TypeDoc