microsoft / microsoft/typespec

Support default value in decorators

Open
#1,897 2 comments 1 reaction 0 assignees View on GitHub
design:needed
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

```
extern dec encode(target: unknown, encoding: string, encodedAs?: string | bytes = string);
```
Would be good to be able to do that.

To decide in design is do we want the property with default to be marked optional or not

```
extern dec encode(target: unknown, encoding: string, encodedAs?: string | bytes = string);
// vs
extern dec encode(target: unknown, encoding: string, encodedAs: string | bytes = string);
```

In typescript they have to be marked required
image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.