Skip to content

Make optional properties optional, not just nullable #3

@schicks

Description

@schicks

Adding a nullable or defaulted field to a record creates a sane avro schema, but still requires the field to be provided (though it can be null or undefined).

const Person = Record('person', {name: Field({type: String(), default: 'odysseus'})

const nobody: AsTypescript<typeof Person> = {} // type error! {} has no property 'name'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions