Skip to content

Optional fields are not supported #327

Open
@ellik95

Description

@ellik95

Describe the bug
It seems that optional fields are not supported. In the target output the getters generators return the type of the field, but they need to return ${type} | undefined.

To Reproduce
Steps to reproduce the behavior:

Props ProjectProps {
  optional string name;
}

Expected behavior
The typescript output must be like below:

get name(): string | undefined {
    return this.props.name;
  }

Additional context
Check if there is other problem with optional and that everything works well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions